/third_party/ltp/testcases/kernel/syscalls/fanotify/ |
D | fanotify04.c | 39 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 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_REMOVE | flag, in check_mark() 112 ret = SAFE_READ(0, fd_notify, event_buf + len, in verify_event() 149 ret = read(fd_notify, event_buf + len, EVENT_BUF_LEN - len); in verify_no_event() 160 tst_res(TFAIL | TERRNO, "read(%d, buf, %zu) failed", fd_notify, in verify_no_event() 189 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD, FAN_OPEN, AT_FDCWD, fname); in test01() 190 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD, FAN_OPEN | FAN_ONDIR, in test01() [all …]
|
D | fanotify03.c | 47 static volatile int fd_notify; variable 155 SAFE_CLOSE(fd_notify); in child_handler() 156 fd_notify = -1; in child_handler() 176 SAFE_CLOSE(fd_notify); in run_child() 221 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY); in setup_mark() 224 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag, in setup_mark() 248 while (test_num < tc->event_count + 1 && fd_notify != -1) { in test_fanotify() 253 ret = read(fd_notify, event_buf + len, in test_fanotify() 255 if (fd_notify == -1) in test_fanotify() 260 fd_notify, EVENT_BUF_LEN); in test_fanotify() [all …]
|
D | fanotify01.c | 77 static int fd_notify; variable 104 fd_notify = SAFE_FANOTIFY_INIT(tc->init_flags, O_RDONLY); in test_fanotify() 106 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag, in test_fanotify() 128 ret = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); in test_fanotify() 146 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify() 155 SAFE_FANOTIFY_MARK(fd_notify, in test_fanotify() 169 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify() 192 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify() 200 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag | in test_fanotify() 218 ret = SAFE_READ(0, fd_notify, event_buf + len, in test_fanotify() [all …]
|
D | fanotify12.c | 40 static volatile int fd_notify; variable 114 SAFE_CLOSE(fd_notify); in generate_events() 147 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY); in setup_mark() 151 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag, in setup_mark() 156 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag in setup_mark() 181 len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); in do_test() 219 if (fd_notify > 0) in do_test() 220 SAFE_CLOSE(fd_notify); in do_test() 234 if (fd_notify > 0) in do_cleanup() 235 SAFE_CLOSE(fd_notify); in do_cleanup()
|
D | fanotify18.c | 45 static int fd_notify; variable 111 fd_notify = fanotify_init(tc->init_flags, O_RDONLY); in test_fanotify() 113 if (fd_notify < 0) { in test_fanotify() 129 if (fanotify_mark(fd_notify, tc->mark_flags, tc->mark_mask, AT_FDCWD, in test_fanotify() 145 fd_notify, in test_fanotify() 156 SAFE_CLOSE(fd_notify); in test_fanotify() 187 if (fd_notify > 0) in cleanup() 188 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify08.c | 27 static int fd_notify; variable 34 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF|fan_bit, O_RDONLY); in test_init_bit() 36 ret = SAFE_FCNTL(fd_notify, F_GETFD); in test_init_bit() 44 SAFE_CLOSE(fd_notify); in test_init_bit() 61 if (fd_notify > 0) in cleanup() 62 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify19.c | 42 static int fd_notify; variable 128 SAFE_CLOSE(fd_notify); in do_fork() 157 fd_notify = fanotify_init(FANOTIFY_REQUIRED_USER_INIT_FLAGS, O_RDONLY); in test_fanotify() 159 if (fd_notify < 0) { in test_fanotify() 171 if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ALL_EVENTS, in test_fanotify() 176 fd_notify, in test_fanotify() 194 len = SAFE_READ(0, fd_notify, event_buf + len, EVENT_BUF_LEN - len); in test_fanotify() 259 SAFE_CLOSE(fd_notify); in test_fanotify() 275 if (fd_notify > 0) in cleanup() 276 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify07.c | 43 static volatile int fd_notify; variable 76 SAFE_CLOSE(fd_notify); in run_children() 132 SAFE_READ(1, fd_notify, &event, sizeof(event)); in loose_fanotify_events() 151 SAFE_WRITE(1, fd_notify, &resp, sizeof(resp)); in loose_fanotify_events() 164 fd_notify = setup_instance(); in test_fanotify() 183 SAFE_CLOSE(fd_notify); in test_fanotify() 204 if (fd_notify > 0) in cleanup() 205 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify02.c | 38 static int fd, fd_notify; variable 50 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD, FAN_ACCESS | in test01() 73 ret = SAFE_READ(0, fd_notify, event_buf, in test01() 92 ret = SAFE_READ(0, fd_notify, event_buf + len, in test01() 99 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_REMOVE, in test01() 120 ret = SAFE_READ(0, fd_notify, event_buf + len, in test01() 183 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY); in setup() 188 if (fd_notify > 0) in cleanup() 189 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify06.c | 63 static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO]; variable 86 fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_prio[p] | in create_fanotify_groups() 91 SAFE_FANOTIFY_MARK(fd_notify[p][i], in create_fanotify_groups() 100 SAFE_FANOTIFY_MARK(fd_notify[p][i], in create_fanotify_groups() 115 if (fd_notify[p][i] > 0) in cleanup_fanotify_groups() 116 SAFE_CLOSE(fd_notify[p][i]); in cleanup_fanotify_groups() 178 ret = read(fd_notify[0][i], event_buf, EVENT_BUF_LEN); in test_fanotify() 206 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test_fanotify()
|
D | fanotify05.c | 64 static int fd, fd_notify; variable 115 fd_notify = SAFE_FANOTIFY_INIT(tc->init_flags | FAN_NONBLOCK, O_RDONLY); in test_fanotify() 117 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_MOUNT | FAN_MARK_ADD, FAN_OPEN, in test_fanotify() 134 len = read(fd_notify, &event, sizeof(event)); in test_fanotify() 184 SAFE_CLOSE(fd_notify); in test_fanotify() 205 if (fd_notify > 0) in cleanup() 206 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify11.c | 61 int fd_notify; in test01() local 73 fd_notify = SAFE_FANOTIFY_INIT(tcases[i], 0); in test01() 75 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD, in test01() 80 SAFE_READ(0, fd_notify, &event, sizeof(struct fanotify_event_metadata)); in test01() 91 SAFE_CLOSE(fd_notify); in test01()
|
D | fanotify09.c | 60 static int fd_notify[NUM_GROUPS]; variable 140 fd_notify[i] = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF | report_name | in create_fanotify_groups() 148 SAFE_FANOTIFY_MARK(fd_notify[i], in create_fanotify_groups() 160 SAFE_FANOTIFY_MARK(fd_notify[i], FAN_MARK_ADD, in create_fanotify_groups() 171 if (fd_notify[i] > 0) in cleanup_fanotify_groups() 172 SAFE_CLOSE(fd_notify[i]); in cleanup_fanotify_groups() 270 ret = read(fd_notify[0], event_buf, EVENT_BUF_LEN); in test_fanotify() 308 ret = read(fd_notify[i], event_buf, EVENT_BUF_LEN); in test_fanotify()
|
D | fanotify22.c | 49 int fd_notify; variable 240 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD|FAN_MARK_FILESYSTEM, in do_test() 245 read_len = SAFE_READ(0, fd_notify, event_buf, BUF_SIZE); in do_test() 247 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_REMOVE|FAN_MARK_FILESYSTEM, in do_test() 283 fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF|FAN_REPORT_FID, in setup() 291 if (fd_notify > 0) in cleanup() 292 SAFE_CLOSE(fd_notify); in cleanup()
|
D | fanotify10.c | 68 static int fd_notify[NUM_CLASSES][GROUPS_PER_PRIO]; variable 303 fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_class[p] | in create_fanotify_groups() 312 SAFE_FANOTIFY_MARK(fd_notify[p][i], in create_fanotify_groups() 326 SAFE_FANOTIFY_MARK(fd_notify[p][i], in create_fanotify_groups() 354 if (fd_notify[p][i] > 0) in cleanup_fanotify_groups() 355 SAFE_CLOSE(fd_notify[p][i]); in cleanup_fanotify_groups() 450 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test_fanotify() 485 ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN); in test_fanotify()
|
D | fanotify16.c | 55 static int fd_notify; variable 164 fd_notify = SAFE_FANOTIFY_INIT(group->flag, 0); in do_test() 169 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | mark->flag, tc->mask, in do_test() 186 SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD | sub_mark->flag, in do_test() 210 len += SAFE_READ(0, fd_notify, event_buf + len, EVENT_BUF_LEN - len); in do_test() 304 len += SAFE_READ(0, fd_notify, event_buf + len, EVENT_BUF_LEN - len); in do_test() 322 SAFE_CLOSE(fd_notify); in do_test() 323 fd_notify = -1; in do_test() 557 if (fd_notify > 0) in cleanup() 558 SAFE_CLOSE(fd_notify); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/inotify/ |
D | inotify05.c | 35 static int fd, fd_notify; variable 65 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify() 69 fd_notify, EVENT_BUF_LEN); in verify_inotify() 131 fd_notify = SAFE_MYINOTIFY_INIT1(O_NONBLOCK); in setup() 133 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS); in setup() 141 if (fd_notify > 0 && myinotify_rm_watch(fd_notify, wd) == -1) { in cleanup() 143 fd_notify, wd); in cleanup() 146 if (fd_notify > 0) in cleanup() 147 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify04.c | 51 int fd_notify, reap_wd_file, reap_wd_dir, wd_dir, wd_file; variable 60 if (reap_wd_dir && myinotify_rm_watch(fd_notify, wd_dir) == -1) in cleanup() 62 "inotify_rm_watch(%d, %d) [1] failed", fd_notify, in cleanup() 65 if (reap_wd_file && myinotify_rm_watch(fd_notify, wd_file) == -1) in cleanup() 67 "inotify_rm_watch(%d, %d) [2] failed", fd_notify, in cleanup() 70 if (fd_notify > 0) in cleanup() 71 SAFE_CLOSE(fd_notify); in cleanup() 76 fd_notify = SAFE_MYINOTIFY_INIT(); in setup() 87 wd_dir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, IN_ALL_EVENTS); in verify_inotify() 90 wd_file = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, IN_ALL_EVENTS); in verify_inotify() [all …]
|
D | inotify03.c | 39 static int fd, fd_notify; variable 61 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS); in verify_inotify() 80 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify() 83 "read(%d, buf, %zu) failed", fd_notify, EVENT_BUF_LEN); in verify_inotify() 119 ret = myinotify_rm_watch(fd_notify, wd); in verify_inotify() 123 fd_notify, wd); in verify_inotify() 126 fd_notify, wd); in verify_inotify() 150 fd_notify = SAFE_MYINOTIFY_INIT(); in setup() 158 if (fd_notify > 0) in cleanup() 159 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify01.c | 37 static int fd, fd_notify; variable 89 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) { in verify_inotify() 92 fd_notify, EVENT_BUF_LEN); in verify_inotify() 145 fd_notify = SAFE_MYINOTIFY_INIT(); in setup() 147 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS); in setup() 153 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup() 155 fd_notify, wd); in cleanup() 158 if (fd_notify > 0) in cleanup() 159 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify08.c | 50 static int fd_notify, reap_wd; variable 87 int len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify() 91 fd_notify, EVENT_BUF_LEN); in verify_inotify() 140 fd_notify = SAFE_MYINOTIFY_INIT1(O_NONBLOCK); in setup() 143 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, FILE_PATH, in setup() 165 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup() 167 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup() 170 if (fd_notify > 0) in cleanup() 171 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify07.c | 49 static int fd_notify, reap_wd; variable 89 int len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify() 93 fd_notify, EVENT_BUF_LEN); in verify_inotify() 149 fd_notify = SAFE_MYINOTIFY_INIT1(O_NONBLOCK); in setup() 152 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, DIR_PATH, IN_ALL_EVENTS); in setup() 171 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup() 173 fd_notify, wd); in cleanup() 176 if (fd_notify > 0) in cleanup() 177 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify10.c | 81 int fd_notify, fd_notify_other; variable 92 fd_notify = SAFE_MYINOTIFY_INIT(); in verify_inotify() 97 wd_parent = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, ".", tc->parent_mask); in verify_inotify() 99 wd_subdir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, tc->subdir_mask); in verify_inotify() 101 wd_child = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, tc->child_mask); in verify_inotify() 145 len = read(fd_notify, event_buf, EVENT_BUF_LEN); in verify_inotify() 187 SAFE_CLOSE(fd_notify); in verify_inotify() 199 if (fd_notify > 0) in cleanup() 200 SAFE_CLOSE(fd_notify); in cleanup()
|
D | inotify02.c | 41 static int fd, fd_notify, reap_wd; variable 125 if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) { in verify_inotify() 128 fd_notify, EVENT_BUF_LEN); in verify_inotify() 218 fd_notify = SAFE_MYINOTIFY_INIT(); in setup() 220 wd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, ".", IN_ALL_EVENTS); in setup() 226 if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) { in cleanup() 228 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd); in cleanup() 231 if (fd_notify > 0) in cleanup() 232 SAFE_CLOSE(fd_notify); in cleanup()
|