1 /*
2 * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
3 * Copyright (c) 2006-2021 Dmitry V. Levin <ldv@strace.io>
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9 #include "defs.h"
10 #include "kernel_fcntl.h"
11
12 #include "xlat/inotify_flags.h"
13 #include "xlat/inotify_init_flags.h"
14
15 SYS_FUNC(inotify_add_watch)
16 {
17 /* file descriptor */
18 printfd(tcp, tcp->u_arg[0]);
19 tprint_arg_next();
20
21 /* pathname */
22 printpath(tcp, tcp->u_arg[1]);
23 tprint_arg_next();
24
25 /* mask */
26 printflags(inotify_flags, tcp->u_arg[2], "IN_???");
27
28 return RVAL_DECODED;
29 }
30
31 SYS_FUNC(inotify_rm_watch)
32 {
33 /* file descriptor */
34 printfd(tcp, tcp->u_arg[0]);
35 tprint_arg_next();
36
37 /* watch descriptor */
38 PRINT_VAL_D((int) tcp->u_arg[1]);
39
40 return RVAL_DECODED;
41 }
42
43 SYS_FUNC(inotify_init)
44 {
45 return RVAL_DECODED | RVAL_FD;
46 }
47
48 SYS_FUNC(inotify_init1)
49 {
50 printflags(inotify_init_flags, tcp->u_arg[0], "IN_???");
51
52 return RVAL_DECODED | RVAL_FD;
53 }