blob: 6eeb9bc8681b671f65cb17a1490fd46bd61ba12e [file] [log] [blame]
Dmitry V. Levin99db95d2014-02-05 04:13:18 +00001#include "defs.h"
2#include <linux/fanotify.h>
3
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +00004#include "xlat/fan_classes.h"
Dmitry V. Levin99db95d2014-02-05 04:13:18 +00005
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +00006#include "xlat/fan_init_flags.h"
Dmitry V. Levin99db95d2014-02-05 04:13:18 +00007
8int
9sys_fanotify_init(struct tcb *tcp)
10{
11 unsigned flags;
12
13 if (exiting(tcp))
14 return 0;
15
16 flags = tcp->u_arg[0];
17 printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???");
18 flags &= ~FAN_ALL_CLASS_BITS;
19 if (flags) {
20 tprints("|");
21 printflags(fan_init_flags, flags, "FAN_???");
22 }
23 tprints(", ");
24 tprint_open_modes((unsigned) tcp->u_arg[1]);
25
26 return 0;
27}
28
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +000029#include "xlat/fan_mark_flags.h"
Dmitry V. Levin99db95d2014-02-05 04:13:18 +000030
Dmitry V. Levin0ed617b2014-04-25 23:30:54 +000031#include "xlat/fan_event_flags.h"
Dmitry V. Levin99db95d2014-02-05 04:13:18 +000032
33int
34sys_fanotify_mark(struct tcb *tcp)
35{
36 if (exiting(tcp))
37 return 0;
38
39 printfd(tcp, tcp->u_arg[0]);
40 tprints(", ");
41 printflags(fan_mark_flags, (unsigned) tcp->u_arg[1], "FAN_MARK_???");
42 tprints(", ");
43 printflags(fan_event_flags, tcp->u_arg[2], "FAN_???");
44 tprints(", ");
45 if ((int) tcp->u_arg[3] == FAN_NOFD)
46 tprints("FAN_NOFD, ");
47 else
48 print_dirfd(tcp, tcp->u_arg[3]);
49 printpath(tcp, tcp->u_arg[4]);
50
51 return 0;
52}