Lines Matching full:fd
47 int fd, flags; in TEST() local
49 fd = sys_eventfd2(0, 0); in TEST()
50 ASSERT_GE(fd, 0); in TEST()
52 flags = fcntl(fd, F_GETFL); in TEST()
56 close(fd); in TEST()
61 int fd, flags; in TEST() local
63 fd = sys_eventfd2(0, EFD_CLOEXEC); in TEST()
64 ASSERT_GE(fd, 0); in TEST()
66 flags = fcntl(fd, F_GETFD); in TEST()
70 close(fd); in TEST()
75 int fd, flags; in TEST() local
77 fd = sys_eventfd2(0, EFD_NONBLOCK); in TEST()
78 ASSERT_GE(fd, 0); in TEST()
80 flags = fcntl(fd, F_GETFL); in TEST()
85 close(fd); in TEST()
90 int fd, flags; in TEST() local
92 fd = sys_eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK); in TEST()
93 ASSERT_GE(fd, 0); in TEST()
95 flags = fcntl(fd, F_GETFL); in TEST()
100 flags = fcntl(fd, F_GETFD); in TEST()
104 close(fd); in TEST()
115 static int verify_fdinfo(int fd, struct error *err, const char *prefix, in verify_fdinfo() argument
132 snprintf(path, sizeof(path), "/proc/self/fdinfo/%d", fd); in verify_fdinfo()
135 return error_set(err, -1, "fdinfo open failed for %d", fd); in verify_fdinfo()
160 return error_set(err, -1, "%s not found for fd %d", in verify_fdinfo()
161 prefix, fd); in verify_fdinfo()
169 int fd, ret; in TEST() local
171 fd = sys_eventfd2(0, EFD_SEMAPHORE); in TEST()
172 ASSERT_GE(fd, 0); in TEST()
174 ret = fcntl(fd, F_GETFL); in TEST()
179 ret = verify_fdinfo(fd, &err, "eventfd-semaphore: ", 19, "1\n"); in TEST()
185 close(fd); in TEST()
197 int fd; in TEST() local
199 fd = sys_eventfd2(0, 0); in TEST()
200 ASSERT_GE(fd, 0); in TEST()
202 size = write(fd, &value, sizeof(int)); in TEST()
206 size = write(fd, &value, sizeof(value)); in TEST()
210 size = write(fd, &value, sizeof(value)); in TEST()
214 close(fd); in TEST()
225 int fd; in TEST() local
227 fd = sys_eventfd2(1, 0); in TEST()
228 ASSERT_GE(fd, 0); in TEST()
230 size = read(fd, &value, sizeof(int)); in TEST()
234 size = read(fd, &value, sizeof(value)); in TEST()
238 close(fd); in TEST()
253 int fd; in TEST() local
256 fd = sys_eventfd2(0, EFD_NONBLOCK); in TEST()
257 ASSERT_GE(fd, 0); in TEST()
261 size = write(fd, &value, sizeof(value)); in TEST()
265 size = read(fd, &value, sizeof(value)); in TEST()
269 size = read(fd, &value, sizeof(value)); in TEST()
273 close(fd); in TEST()
287 int fd; in TEST() local
290 fd = sys_eventfd2(0, EFD_SEMAPHORE|EFD_NONBLOCK); in TEST()
291 ASSERT_GE(fd, 0); in TEST()
295 size = write(fd, &value, sizeof(value)); in TEST()
300 size = read(fd, &value, sizeof(value)); in TEST()
305 size = read(fd, &value, sizeof(value)); in TEST()
309 close(fd); in TEST()