Lines Matching defs:dir_fd
83 static char *shell_test__description(int dir_fd, const char *name)
92 io__init(&io, openat(dir_fd, name, O_RDONLY), buf, sizeof(buf));
133 static bool is_shell_script(int dir_fd, const char *path)
141 if (faccessat(dir_fd, path, R_OK | X_OK, 0) == 0) /* Is executable */
148 static bool is_test_script(int dir_fd, const char *name)
150 return is_shell_script(dir_fd, name);
182 static void append_script(int dir_fd, const char *name, char *desc,
192 snprintf(link, sizeof(link), "/proc/%d/fd/%d", getpid(), dir_fd);
238 static void append_scripts_in_dir(int dir_fd,
247 n_dirs = scandirat(dir_fd, ".", &entlist, NULL, alphasort);
255 if (is_test_script(dir_fd, ent->d_name)) { /* It's a test */
256 char *desc = shell_test__description(dir_fd, ent->d_name);
259 append_script(dir_fd, ent->d_name, desc, result, result_sz);
267 fstatat(dir_fd, ent->d_name, &st, 0);
273 fd = openat(dir_fd, ent->d_name, O_PATH);
286 int dir_fd = shell_tests__dir_fd(); /* Walk dir */
292 if (dir_fd >= 0)
293 append_scripts_in_dir(dir_fd, &result, &result_sz);
303 if (dir_fd >= 0)
304 close(dir_fd);