Home
last modified time | relevance | path

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

/external/ltp/testcases/kernel/syscalls/fanotify/
Dfanotify04.c39 static int fd_notify; variable
61 if (fanotify_mark(fd_notify, FAN_MARK_ADD | flag, FAN_OPEN, AT_FDCWD, in check_mark()
65 "AT_FDCWD, '%s') %s", fd_notify, flagstr, file, in check_mark()
70 "AT_FDCWD, '%s') %s", fd_notify, flagstr, file, in check_mark()
80 if (fanotify_mark(fd_notify, FAN_MARK_REMOVE | flag, in check_mark()
85 fd_notify, flagstr, file); in check_mark()
117 ret = SAFE_READ(0, fd_notify, event_buf + len, in verify_event()
154 ret = read(fd_notify, event_buf + len, EVENT_BUF_LEN - len); in verify_no_event()
165 tst_res(TFAIL | TERRNO, "read(%d, buf, %zu) failed", fd_notify, in verify_no_event()
194 if (fanotify_mark(fd_notify, FAN_MARK_ADD, in test01()
[all …]
Dfanotify01.c55 static int fd_notify; variable
70 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY); in test_fanotify()
72 if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag, in test_fanotify()
83 "failed", fd_notify, mark->name, fname); in test_fanotify()
105 ret = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); in test_fanotify()
123 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify()
132 if (fanotify_mark(fd_notify, in test_fanotify()
138 "failed", fd_notify, mark->name, fname); in test_fanotify()
151 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify()
174 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify()
[all …]
Dfanotify03.c41 static volatile int fd_notify; variable
95 close(fd_notify); in child_handler()
96 fd_notify = -1; in child_handler()
115 close(fd_notify); in run_child()
146 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY); in setup_mark()
148 if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag, in setup_mark()
164 fd_notify, mark->name, fname); in setup_mark()
199 while (test_num < TST_TOTAL && fd_notify != -1) { in test_fanotify()
204 ret = read(fd_notify, event_buf + len, in test_fanotify()
206 if (fd_notify == -1) in test_fanotify()
[all …]
Dfanotify02.c37 static int fd, fd_notify; variable
49 if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS | in test01()
57 "failed", fd_notify); in test01()
79 ret = SAFE_READ(0, fd_notify, event_buf, in test01()
98 ret = SAFE_READ(0, fd_notify, event_buf + len, in test01()
105 if (fanotify_mark(fd_notify, FAN_MARK_REMOVE, in test01()
110 fd_notify); in test01()
131 ret = SAFE_READ(0, fd_notify, event_buf + len, in test01()
194 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY); in setup()
199 if (fd_notify > 0) in cleanup()
[all …]
Dfanotify06.c53 static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO]; variable
67 fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_prio[p] | in create_fanotify_groups()
72 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
80 " '.') failed", fd_notify[p][i]); in create_fanotify_groups()
85 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
96 fd_notify[p][i], fname); in create_fanotify_groups()
108 if (fd_notify[p][i] > 0) in cleanup_fanotify_groups()
109 SAFE_CLOSE(fd_notify[p][i]); in cleanup_fanotify_groups()
148 ret = read(fd_notify[0][i], event_buf, EVENT_BUF_LEN); in test01()
176 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test01()
Dfanotify08.c26 static int fd_notify; variable
33 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF|fan_bit, O_RDONLY); in test_init_bit()
35 ret = SAFE_FCNTL(fd_notify, F_GETFD); in test_init_bit()
43 SAFE_CLOSE(fd_notify); in test_init_bit()
60 if (fd_notify > 0) in cleanup()
61 SAFE_CLOSE(fd_notify); in cleanup()
Dfanotify07.c41 static volatile int fd_notify; variable
76 close(fd_notify); in run_children()
135 SAFE_READ(1, fd_notify, &event, sizeof(event)); in loose_fanotify_events()
154 SAFE_WRITE(1, fd_notify, &resp, sizeof(resp)); in loose_fanotify_events()
167 fd_notify = setup_instance(); in test_fanotify()
187 SAFE_CLOSE(fd_notify); in test_fanotify()
204 if (fd_notify > 0) in cleanup()
205 SAFE_CLOSE(fd_notify); in cleanup()
Dfanotify05.c34 static int fd, fd_notify; variable
56 len = read(fd_notify, &event, sizeof(event)); in test01()
104 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF | FAN_NONBLOCK, in setup()
107 if (fanotify_mark(fd_notify, FAN_MARK_MOUNT | FAN_MARK_ADD, FAN_OPEN, in setup()
112 fd_notify); in setup()
118 if (fd_notify > 0) in cleanup()
119 SAFE_CLOSE(fd_notify); in cleanup()
Dfanotify09.c49 static int fd_notify[NUM_GROUPS]; variable
80 fd_notify[i] = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF | in create_fanotify_groups()
86 ret = fanotify_mark(fd_notify[i], in create_fanotify_groups()
94 " '.') failed", fd_notify[i], in create_fanotify_groups()
104 ret = fanotify_mark(fd_notify[i], FAN_MARK_ADD, in create_fanotify_groups()
111 fd_notify[i], in create_fanotify_groups()
123 if (fd_notify[i] > 0) in cleanup_fanotify_groups()
124 SAFE_CLOSE(fd_notify[i]); in cleanup_fanotify_groups()
180 ret = read(fd_notify[0], event_buf, EVENT_BUF_LEN); in test_fanotify()
216 ret = read(fd_notify[i], event_buf, FAN_EVENT_METADATA_LEN); in test_fanotify()
Dfanotify11.c61 int fd_notify; in test01() local
68 fd_notify = fanotify_init(tcases[i], 0); in test01()
69 if (fd_notify < 0) { in test01()
79 ret = fanotify_mark(fd_notify, FAN_MARK_ADD, in test01()
86 SAFE_READ(0, fd_notify, &event, sizeof(struct fanotify_event_metadata)); in test01()
97 SAFE_CLOSE(fd_notify); in test01()
Dfanotify10.c51 static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO]; variable
149 fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_prio[p] | in create_fanotify_groups()
154 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
168 fd_notify[p][i], mark->name, in create_fanotify_groups()
174 ret = fanotify_mark(fd_notify[p][i], in create_fanotify_groups()
186 fd_notify[p][i], ignore_mark->name, in create_fanotify_groups()
200 if (fd_notify[p][i] > 0) in cleanup_fanotify_groups()
201 SAFE_CLOSE(fd_notify[p][i]); in cleanup_fanotify_groups()
253 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test_fanotify()
285 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test_fanotify()
/external/ltp/testcases/kernel/syscalls/inotify/
Dinotify05.c50 static int fd, fd_notify; variable
80 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify()
84 fd_notify, EVENT_BUF_LEN); in verify_inotify()
146 fd_notify = myinotify_init1(O_NONBLOCK); in setup()
147 if (fd_notify < 0) { in setup()
157 wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS); in setup()
161 fd_notify, fname); in setup()
170 if (fd_notify > 0 && myinotify_rm_watch(fd_notify, wd) == -1) { in cleanup()
172 fd_notify, wd); in cleanup()
176 if (fd_notify > 0) in cleanup()
[all …]
Dinotify04.c73 int fd_notify, reap_wd_file, reap_wd_dir, wd_dir, wd_file; variable
82 if (reap_wd_dir && myinotify_rm_watch(fd_notify, wd_dir) == -1) in cleanup()
84 "inotify_rm_watch(%d, %d) [1] failed", fd_notify, in cleanup()
87 if (reap_wd_file && myinotify_rm_watch(fd_notify, wd_file) == -1) in cleanup()
89 "inotify_rm_watch(%d, %d) [2] failed", fd_notify, in cleanup()
92 if (fd_notify > 0) in cleanup()
93 SAFE_CLOSE(fd_notify); in cleanup()
98 fd_notify = myinotify_init(); in setup()
99 if (fd_notify == -1) { in setup()
118 wd_dir = myinotify_add_watch(fd_notify, TEST_DIR, IN_ALL_EVENTS); in verify_inotify()
[all …]
Dinotify03.c58 static int fd, fd_notify; variable
80 wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS); in verify_inotify()
84 fd_notify, fname); in verify_inotify()
104 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify()
107 "read(%d, buf, %zu) failed", fd_notify, EVENT_BUF_LEN); in verify_inotify()
143 ret = myinotify_rm_watch(fd_notify, wd); in verify_inotify()
147 fd_notify, wd); in verify_inotify()
150 fd_notify, wd); in verify_inotify()
174 fd_notify = myinotify_init(); in setup()
175 if (fd_notify < 0) { in setup()
[all …]
Dinotify08.c70 static int fd_notify, reap_wd; variable
110 int len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify()
114 fd_notify, EVENT_BUF_LEN); in verify_inotify()
178 fd_notify = myinotify_init1(O_NONBLOCK); in setup()
179 if (fd_notify < 0) { in setup()
190 if ((wd = myinotify_add_watch(fd_notify, FILE_PATH, in setup()
195 fd_notify); in setup()
217 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
219 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup()
223 if (fd_notify > 0) in cleanup()
[all …]
Dinotify07.c68 static int fd_notify, reap_wd; variable
111 int len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify()
115 fd_notify, EVENT_BUF_LEN); in verify_inotify()
186 fd_notify = myinotify_init1(O_NONBLOCK); in setup()
187 if (fd_notify < 0) { in setup()
198 if ((wd = myinotify_add_watch(fd_notify, DIR_PATH, IN_ALL_EVENTS)) < 0) { in setup()
201 fd_notify); in setup()
221 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
223 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup()
227 if (fd_notify > 0) in cleanup()
[all …]
Dinotify01.c56 static int fd, fd_notify; variable
114 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) { in verify_inotify()
117 fd_notify, EVENT_BUF_LEN); in verify_inotify()
170 if ((fd_notify = myinotify_init()) < 0) { in setup()
180 if ((wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS)) < 0) { in setup()
183 fd_notify, fname); in setup()
191 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
193 fd_notify, wd); in cleanup()
196 if (fd_notify > 0) in cleanup()
197 SAFE_CLOSE(fd_notify); in cleanup()
Dinotify02.c60 static int fd, fd_notify, reap_wd; variable
144 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) { in verify_inotify()
147 fd_notify, EVENT_BUF_LEN); in verify_inotify()
237 if ((fd_notify = myinotify_init()) < 0) { in setup()
247 if ((wd = myinotify_add_watch(fd_notify, ".", IN_ALL_EVENTS)) < 0) { in setup()
250 fd_notify); in setup()
257 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup()
259 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup()
263 if (fd_notify > 0) in cleanup()
264 SAFE_CLOSE(fd_notify); in cleanup()