Lines Matching refs:fd
44 int dir_fd, fd; in kernel_thread_fd() local
56 fd = openat(dir_fd, "stat", O_RDONLY); in kernel_thread_fd()
57 if (fd == -1) { in kernel_thread_fd()
61 rv = read(fd, buf, sizeof(buf)); in kernel_thread_fd()
62 close(fd); in kernel_thread_fd()
88 fd = -1; in kernel_thread_fd()
90 fd = openat(dir_fd, "fd", O_RDONLY|O_DIRECTORY); in kernel_thread_fd()
93 return fd; in kernel_thread_fd()
96 static void test_readdir(int fd) in test_readdir() argument
101 d = fdopendir(fd); in test_readdir()
122 static void test_lookup_fail(int fd, const char *pathname) in test_lookup_fail() argument
127 rv = sys_statx(fd, pathname, AT_SYMLINK_NOFOLLOW, 0, (void *)stx); in test_lookup_fail()
131 static void test_lookup(int fd) in test_lookup() argument
139 test_lookup_fail(fd, buf); in test_lookup()
143 test_lookup_fail(fd, buf); in test_lookup()
147 test_lookup_fail(fd, buf); in test_lookup()
151 test_lookup_fail(fd, buf); in test_lookup()
158 int fd; in main() local
167 while ((fd = kernel_thread_fd(pid)) == -1 && pid < 1024) { in main()
174 test_readdir(fd); in main()
175 test_lookup(fd); in main()