2 * Check decoding of fanotify_init syscall.
4 * Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
5 * Copyright (c) 2016-2019 The strace developers.
8 * SPDX-License-Identifier: GPL-2.0-or-later
15 #if defined __NR_fanotify_init
21 /* Performs fanotify_init call via the syscall interface. */
23 do_call(kernel_ulong_t flags, const char *flags_str,
24 kernel_ulong_t event_f_flags, const char *event_f_flags_str)
28 rc = syscall(__NR_fanotify_init, flags, event_f_flags);
30 printf("fanotify_init(%s, %s) = %s\n",
31 flags_str, event_f_flags_str, sprintrc(rc));
43 static const struct strval flags[] = {
44 { F8ILL_KULONG_MASK, "FAN_CLASS_NOTIF" },
45 { (kernel_ulong_t) 0xffffffff0000000cULL,
46 "0xc /* FAN_CLASS_??? */" },
47 { (kernel_ulong_t) 0xdec0deddefacec04ULL,
48 "FAN_CLASS_CONTENT|0xefacec00 /* FAN_??? */" },
49 { (kernel_ulong_t) 0xffffffffffffffffULL,
50 "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|"
51 "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|"
52 "FAN_ENABLE_AUDIT|FAN_REPORT_TID|FAN_REPORT_FID|"
55 static const struct strval event_f_flags[] = {
56 { F8ILL_KULONG_MASK, "O_RDONLY" },
57 { (kernel_ulong_t) 0xdeadbeef80000001ULL,
58 "O_WRONLY|0x80000000" }
65 for (i = 0; i < ARRAY_SIZE(flags); i++)
66 for (j = 0; j < ARRAY_SIZE(event_f_flags); j++)
67 do_call(flags[i].val, flags[i].str,
68 event_f_flags[j].val, event_f_flags[j].str);
70 puts("+++ exited with 0 +++");
76 SKIP_MAIN_UNDEFINED("__NR_fanotify_init")