1 /*
2 * Check decoding of inotify_init syscall.
3 *
4 * Copyright (c) 2018-2019 The strace developers.
5 * All rights reserved.
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #include "tests.h"
11 #include "scno.h"
12
13 #ifdef __NR_inotify_init
14
15 # include <stdio.h>
16 # include <unistd.h>
17
18 int
19 main(void)
20 {
21 # ifdef PRINT_PATHS
22 skip_if_unavailable("/proc/self/fd/");
23 # endif
24
25 long rc = syscall(__NR_inotify_init, 42);
26
27 # ifdef PRINT_PATHS
28 if (rc < 0)
29 perror_msg_and_skip("inotify_init");
30 # endif
31
32 printf("inotify_init() = "
33 # ifdef PRINT_PATHS
34 "%ld<anon_inode:inotify>\n", rc
35 # else
36 "%s\n", sprintrc(rc)
37 # endif
38 );
39
40 puts("+++ exited with 0 +++");
41 return 0;
42 }
43
44 #else
45
46 SKIP_MAIN_UNDEFINED("__NR_inotify_init");
47
48 #endif