/external/ltp/testcases/kernel/syscalls/fanotify/ |
D | fanotify03.c | 64 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 …]
|
D | fanotify04.c | 63 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 …]
|
D | fanotify01.c | 61 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 …]
|
D | fanotify06.c | 80 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 …]
|
D | fanotify05.c | 56 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()
|
D | fanotify02.c | 61 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/ |
D | inotify04.c | 78 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 …]
|
D | inotify05.c | 58 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 …]
|
D | inotify03.c | 65 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 …]
|
D | inotify01.c | 62 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()
|
D | inotify02.c | 66 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()
|