Home
last modified time | relevance | path

Searched refs:fd_notify (Results 1 – 11 of 11) sorted by relevance

/external/ltp/testcases/kernel/syscalls/fanotify/
Dfanotify03.c64 static volatile int fd_notify; variable
99 close(fd_notify); in child_handler()
100 fd_notify = -1; in child_handler()
119 close(fd_notify); in run_child()
172 fd_notify_backup = dup(fd_notify); in main()
175 "dup(%d) failed", fd_notify); in main()
196 while (test_num < TST_TOTAL && fd_notify != -1) { in main()
201 ret = read(fd_notify, event_buf + len, in main()
203 if (fd_notify == -1) in main()
208 fd_notify, EVENT_BUF_LEN); in main()
[all …]
Dfanotify04.c63 static int fd_notify; variable
85 if (fanotify_mark(fd_notify, FAN_MARK_ADD | flag, FAN_OPEN, AT_FDCWD, in check_mark()
89 "'%s') %s", fd_notify, flagstr, file, expect_str_fail(expect)); in check_mark()
93 "'%s') %s", fd_notify, flagstr, file, expect_str_pass(expect)); in check_mark()
102 if (fanotify_mark(fd_notify, FAN_MARK_REMOVE | flag, in check_mark()
107 fd_notify, flagstr, file); in check_mark()
141 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in verify_event()
179 ret = read(fd_notify, event_buf + len, EVENT_BUF_LEN - len); in verify_no_event()
189 tst_resm(TFAIL | TERRNO, "read(%d, buf, %zu) failed", fd_notify, in verify_no_event()
225 if (fanotify_mark(fd_notify, FAN_MARK_ADD, in main()
[all …]
Dfanotify01.c61 static int fd, fd_notify; variable
80 if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS | FAN_MODIFY | in main()
85 "failed", fd_notify, fname); in main()
107 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf, EVENT_BUF_LEN); in main()
125 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in main()
134 if (fanotify_mark(fd_notify, in main()
140 "AT_FDCWD, %s) failed", fd_notify, fname); in main()
153 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in main()
176 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in main()
184 if (fanotify_mark(fd_notify, in main()
[all …]
Dfanotify06.c80 static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO]; variable
94 fd_notify[p][i] = fanotify_init(fanotify_prio[p] | in create_fanotify_groups()
97 if (fd_notify[p][i] < 0) { in create_fanotify_groups()
108 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
116 " '.') failed", fd_notify[p][i]); in create_fanotify_groups()
121 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
132 fd_notify[p][i], fname); in create_fanotify_groups()
144 if (fd_notify[p][i] && fd_notify[p][i] != -1) { in cleanup_fanotify_groups()
145 if (close(fd_notify[p][i]) == -1) in cleanup_fanotify_groups()
147 fd_notify[p][i]); in cleanup_fanotify_groups()
[all …]
Dfanotify05.c56 static int fd, fd_notify; variable
83 len = read(fd_notify, &event, sizeof(event)); in main()
141 fd_notify = fanotify_init(FAN_CLASS_NOTIF | FAN_NONBLOCK, O_RDONLY); in setup()
142 if (fd_notify < 0) { in setup()
152 if (fanotify_mark(fd_notify, FAN_MARK_MOUNT | FAN_MARK_ADD, FAN_OPEN, in setup()
157 fd_notify); in setup()
163 if (fd_notify > 0 && close(fd_notify)) in cleanup()
164 tst_resm(TWARN | TERRNO, "close(%d) failed", fd_notify); in cleanup()
Dfanotify02.c61 static int fd, fd_notify; variable
80 if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS | in main()
88 "failed", fd_notify); in main()
110 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf, in main()
129 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in main()
136 if (fanotify_mark(fd_notify, FAN_MARK_REMOVE, in main()
141 fd_notify); in main()
162 ret = SAFE_READ(cleanup, 0, fd_notify, event_buf + len, in main()
234 if ((fd_notify = fanotify_init(FAN_CLASS_NOTIF, O_RDONLY)) < 0) { in setup()
247 if (fd_notify > 0 && close(fd_notify)) in cleanup()
[all …]
/external/ltp/testcases/kernel/syscalls/inotify/
Dinotify04.c78 int fd_notify, reap_wd_file, reap_wd_dir, wd_dir, wd_file; variable
88 if (reap_wd_dir && myinotify_rm_watch(fd_notify, wd_dir) == -1) in cleanup()
90 "inotify_rm_watch(%d, %d) [1] failed", fd_notify, in cleanup()
93 if (reap_wd_file && myinotify_rm_watch(fd_notify, wd_file) == -1) in cleanup()
95 "inotify_rm_watch(%d, %d) [2] failed", fd_notify, in cleanup()
98 if (fd_notify > 0 && close(fd_notify)) in cleanup()
99 tst_resm(TWARN, "close(%d) [1] failed", fd_notify); in cleanup()
119 fd_notify = myinotify_init(); in setup()
120 if (fd_notify == -1) { in setup()
134 wd_dir = myinotify_add_watch(fd_notify, TEST_DIR, IN_ALL_EVENTS); in setup()
[all …]
Dinotify05.c58 static int fd, fd_notify; variable
93 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in main()
97 fd_notify, EVENT_BUF_LEN); in main()
169 fd_notify = syscall(__NR_inotify_init1, O_NONBLOCK); in setup()
170 if (fd_notify < 0) { in setup()
180 wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS); in setup()
184 fd_notify, fname); in setup()
193 if (fd_notify > 0 && myinotify_rm_watch(fd_notify, wd) == -1) { in cleanup()
195 fd_notify, wd); in cleanup()
199 if (fd_notify > 0 && close(fd_notify) == -1) in cleanup()
[all …]
Dinotify03.c65 static int fd, fd_notify; variable
113 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in main()
116 "read(%d, buf, %zu) failed", fd_notify, EVENT_BUF_LEN); in main()
152 ret = myinotify_rm_watch(fd_notify, wd); in main()
156 fd_notify, wd); in main()
159 fd_notify, wd); in main()
217 fd_notify = myinotify_init(); in setup()
219 if (fd_notify < 0) { in setup()
228 wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS); in setup()
232 fd_notify, fname); in setup()
[all …]
Dinotify01.c62 static int fd, fd_notify; variable
140 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) { in main()
143 fd_notify, EVENT_BUF_LEN); in main()
218 if ((fd_notify = myinotify_init()) < 0) { in setup()
228 if ((wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS)) < 0) { in setup()
231 fd_notify, fname); in setup()
239 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
241 fd_notify, wd); in cleanup()
245 if (fd_notify > 0 && close(fd_notify)) in cleanup()
246 tst_resm(TWARN, "close(%d) failed", fd_notify); in cleanup()
Dinotify02.c66 static int fd, fd_notify, reap_wd; variable
186 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) { in main()
189 fd_notify, EVENT_BUF_LEN); in main()
290 if ((fd_notify = myinotify_init()) < 0) { in setup()
300 if ((wd = myinotify_add_watch(fd_notify, ".", IN_ALL_EVENTS)) < 0) { in setup()
303 fd_notify); in setup()
311 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
313 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup()
317 if (fd_notify > 0 && close(fd_notify)) in cleanup()
318 tst_resm(TWARN, "close(%d) failed", fd_notify); in cleanup()