]> granicus.if.org Git - strace/blob - fanotify.c
decode_poll_exiting: reserve more space in output buffer
[strace] / fanotify.c
1 #include "defs.h"
2
3 #include "xlat/fan_classes.h"
4 #include "xlat/fan_init_flags.h"
5
6 #ifndef FAN_ALL_CLASS_BITS
7 # define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
8 #endif
9 #ifndef FAN_NOFD
10 # define FAN_NOFD -1
11 #endif
12
13 SYS_FUNC(fanotify_init)
14 {
15         unsigned flags;
16
17         flags = tcp->u_arg[0];
18         printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???");
19         flags &= ~FAN_ALL_CLASS_BITS;
20         if (flags) {
21                 tprints("|");
22                 printflags(fan_init_flags, flags, "FAN_???");
23         }
24         tprints(", ");
25         tprint_open_modes((unsigned) tcp->u_arg[1]);
26
27         return RVAL_DECODED;
28 }
29
30 #include "xlat/fan_mark_flags.h"
31 #include "xlat/fan_event_flags.h"
32
33 SYS_FUNC(fanotify_mark)
34 {
35         unsigned long long mask = 0;
36         int argn;
37
38         printfd(tcp, tcp->u_arg[0]);
39         tprints(", ");
40         printflags(fan_mark_flags, (unsigned) tcp->u_arg[1], "FAN_MARK_???");
41         tprints(", ");
42         /*
43          * the mask argument is defined as 64-bit,
44          * but kernel uses the lower 32 bits only.
45          */
46         argn = getllval(tcp, &mask, 2);
47 #ifdef HPPA
48         /* Parsic is weird.  See arch/parisc/kernel/sys_parisc32.c.  */
49         mask = (mask << 32) | (mask >> 32);
50 #endif
51         printflags(fan_event_flags, mask, "FAN_???");
52         tprints(", ");
53         if ((int) tcp->u_arg[argn] == FAN_NOFD)
54                 tprints("FAN_NOFD, ");
55         else
56                 print_dirfd(tcp, tcp->u_arg[argn]);
57         printpath(tcp, tcp->u_arg[argn + 1]);
58
59         return RVAL_DECODED;
60 }