File: inotify_init.c

package info (click to toggle)
trinity 1.9%2Bgit20200331.4d2343bd18c7b-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,080 kB
  • sloc: ansic: 32,746; sh: 536; makefile: 164
file content (54 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * SYSCALL_DEFINE0(inotify_init)
 */
#include "objects.h"
#include "sanitise.h"
#include "tables.h"
#include "utils.h"

static void post_inotify_init(struct syscallrecord *rec)
{
	struct object *new;
	int fd = rec->retval;

	if (fd == -1)
		return;

	new = alloc_object();
	new->inotifyobj.fd = fd;
	if (this_syscallname("inotify_init1"))
		new->inotifyobj.flags = rec->a1;
	else
		new->inotifyobj.flags = 0;
	add_object(new, OBJ_LOCAL, OBJ_FD_INOTIFY);
}

struct syscallentry syscall_inotify_init = {
	.name = "inotify_init",
	.num_args = 0,
	.group = GROUP_VFS,
	.rettype = RET_FD,
	.post = post_inotify_init,
};

/*
 * SYSCALL_DEFINE1(inotify_init1, int, flags)
 */

#define IN_CLOEXEC 02000000
#define IN_NONBLOCK 04000

static unsigned long inotify_init1_flags[] = {
	IN_CLOEXEC , IN_NONBLOCK,
};

struct syscallentry syscall_inotify_init1 = {
	.name = "inotify_init1",
	.num_args = 1,
	.arg1name = "flags",
	.arg1type = ARG_LIST,
	.arg1list = ARGLIST(inotify_init1_flags),
	.group = GROUP_VFS,
	.rettype = RET_FD,
	.post = post_inotify_init,
};