• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "defs.h"
2 #include <linux/fanotify.h>
3 
4 #include "xlat/fan_classes.h"
5 #include "xlat/fan_init_flags.h"
6 
7 int
sys_fanotify_init(struct tcb * tcp)8 sys_fanotify_init(struct tcb *tcp)
9 {
10 	unsigned flags;
11 
12 	if (exiting(tcp))
13 		return 0;
14 
15 	flags = tcp->u_arg[0];
16 	printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???");
17 	flags &= ~FAN_ALL_CLASS_BITS;
18 	if (flags) {
19 		tprints("|");
20 		printflags(fan_init_flags, flags, "FAN_???");
21 	}
22 	tprints(", ");
23 	tprint_open_modes((unsigned) tcp->u_arg[1]);
24 
25 	return 0;
26 }
27 
28 #include "xlat/fan_mark_flags.h"
29 #include "xlat/fan_event_flags.h"
30 
31 int
sys_fanotify_mark(struct tcb * tcp)32 sys_fanotify_mark(struct tcb *tcp)
33 {
34 	if (exiting(tcp))
35 		return 0;
36 
37 	printfd(tcp, tcp->u_arg[0]);
38 	tprints(", ");
39 	printflags(fan_mark_flags, (unsigned) tcp->u_arg[1], "FAN_MARK_???");
40 	tprints(", ");
41 	printflags(fan_event_flags, tcp->u_arg[2], "FAN_???");
42 	tprints(", ");
43 	if ((int) tcp->u_arg[3] == FAN_NOFD)
44 		tprints("FAN_NOFD, ");
45 	else
46 		print_dirfd(tcp, tcp->u_arg[3]);
47 	printpath(tcp, tcp->u_arg[4]);
48 
49 	return 0;
50 }
51