2 * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
3 * Copyright (c) 2014-2019 The strace developers.
6 * SPDX-License-Identifier: LGPL-2.1-or-later
11 #include "xlat/fan_classes.h"
12 #include "xlat/fan_init_flags.h"
14 #ifndef FAN_ALL_CLASS_BITS
15 # define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
21 SYS_FUNC(fanotify_init)
23 unsigned int flags = tcp->u_arg[0];
25 printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???");
26 flags &= ~FAN_ALL_CLASS_BITS;
29 printflags(fan_init_flags, flags, "FAN_???");
32 tprint_open_modes((unsigned) tcp->u_arg[1]);
34 return RVAL_DECODED | RVAL_FD;
37 #include "xlat/fan_mark_flags.h"
38 #include "xlat/fan_event_flags.h"
40 SYS_FUNC(fanotify_mark)
42 printfd(tcp, tcp->u_arg[0]);
44 printflags(fan_mark_flags, tcp->u_arg[1], "FAN_MARK_???");
47 * the mask argument is defined as 64-bit,
48 * but kernel uses the lower 32 bits only.
50 unsigned long long mask = 0;
51 int argn = getllval(tcp, &mask, 2);
53 /* Parsic is weird. See arch/parisc/kernel/sys_parisc32.c. */
54 mask = (mask << 32) | (mask >> 32);
56 printflags64(fan_event_flags, mask, "FAN_???");
58 if ((int) tcp->u_arg[argn] == FAN_NOFD)
59 print_xlat_d(FAN_NOFD);
61 print_dirfd(tcp, tcp->u_arg[argn]);
63 printpath(tcp, tcp->u_arg[argn + 1]);