Home
last modified time | relevance | path

Searched refs:dirfd (Results 1 – 25 of 127) sorted by relevance

123456

/external/igt-gpu-tools/runner/
Drunner_tests.c49 static char *dump_file(int dirfd, const char *name) in dump_file() argument
51 int fd = openat(dirfd, name, O_RDONLY); in dump_file()
116 static void clear_directory_fd(int dirfd) in clear_directory_fd() argument
121 d = fdopendir(dirfd); in clear_directory_fd()
123 if (dirfd < 0 || d == NULL) { in clear_directory_fd()
131 unlinkat(dirfd, dirent->d_name, 0); in clear_directory_fd()
133 clear_directory_fd(openat(dirfd, dirent->d_name, O_DIRECTORY | O_RDONLY)); in clear_directory_fd()
134 unlinkat(dirfd, dirent->d_name, AT_REMOVEDIR); in clear_directory_fd()
144 int dirfd = open(name, O_DIRECTORY | O_RDONLY); in clear_directory() local
145 clear_directory_fd(dirfd); in clear_directory()
[all …]
Djob_list.c385 int dirfd, fd; in create_job_list() local
395 dirfd = open(settings->test_root, O_DIRECTORY | O_RDONLY); in create_job_list()
396 if (dirfd < 0) { in create_job_list()
401 fd = openat(dirfd, "test-list.txt", O_RDONLY); in create_job_list()
404 close(dirfd); in create_job_list()
420 close(dirfd); in create_job_list()
428 int dirfd, fd; in serialize_job_list() local
437 if ((dirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) { in serialize_job_list()
439 if ((dirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) { in serialize_job_list()
446 faccessat(dirfd, joblist_filename, F_OK, 0) == 0) { in serialize_job_list()
[all …]
Dresults.c11 int dirfd; in main() local
16 dirfd = open(argv[1], O_DIRECTORY | O_RDONLY); in main()
17 if (dirfd < 0) in main()
20 if (generate_results(dirfd)) { in main()
Dsettings.c477 int dirfd, fd; in validate_settings() local
494 dirfd = open(settings->test_root, O_DIRECTORY | O_RDONLY); in validate_settings()
495 if (dirfd < 0) { in validate_settings()
500 fd = openat(dirfd, "test-list.txt", O_RDONLY); in validate_settings()
503 close(dirfd); in validate_settings()
508 close(dirfd); in validate_settings()
558 int dirfd, fd; in serialize_settings() local
566 if ((dirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) { in serialize_settings()
568 if ((dirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) { in serialize_settings()
575 faccessat(dirfd, settings_filename, F_OK, 0) == 0) { in serialize_settings()
[all …]
Dexecutor.c332 static int open_at_end(int dirfd, const char *name) in open_at_end() argument
334 int fd = openat(dirfd, name, O_RDWR | O_CREAT | O_CLOEXEC, 0666); in open_at_end()
349 static int open_for_reading(int dirfd, const char *name) in open_for_reading() argument
351 return openat(dirfd, name, O_RDONLY); in open_for_reading()
354 bool open_output_files(int dirfd, int *fds, bool write) in open_output_files() argument
360 if ((fds[i] = openfunc(dirfd, filenames[i])) < 0) { in open_output_files()
912 int dirfd; in execute_next_entry() local
925 if ((dirfd = openat(resdirfd, name, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) < 0) { in execute_next_entry()
930 if (!open_output_files(dirfd, outputs, true)) { in execute_next_entry()
937 fsync(dirfd); in execute_next_entry()
[all …]
Drunner_json_tests.c126 static void run_results_and_compare(int dirfd, const char *dirname) in run_results_and_compare() argument
128 int testdirfd = openat(dirfd, dirname, O_RDONLY | O_DIRECTORY); in run_results_and_compare()
169 int dirfd = open(testdatadir, O_RDONLY | O_DIRECTORY); variable
172 igt_assert_fd(dirfd);
176 run_results_and_compare(dirfd, dirnames[i]); in igt_subtest()
Dresume.c19 int dirfd; in main() local
29 if ((dirfd = open(argv[1], O_RDONLY | O_DIRECTORY)) < 0) { in main()
34 if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list)) { in main()
Dresultgen.h6 bool generate_results(int dirfd);
9 struct json_object *generate_results_json(int dirfd);
/external/ltp/testcases/network/nfs/nfs_stress/
Dnfs05_make_tree.c128 int i, k, fd, dirfd, ret; in thread_fn() local
138 dirfd = SAFE_OPEN(dirname, O_DIRECTORY); in thread_fn()
142 fd = openat(dirfd, "makefile", O_CREAT | O_RDWR, in thread_fn()
156 fd = openat(dirfd, cfile, O_CREAT | O_RDWR, in thread_fn()
170 ret = mkdirat(dirfd, "dir", 0755); in thread_fn()
173 dirfd = openat(dirfd, "dir", O_DIRECTORY); in thread_fn()
174 if (dirfd < 0) in thread_fn()
/external/ltp/testcases/kernel/syscalls/utimensat/
Dutimensat01.c71 utimensat_sc(int dirfd, const char *pathname, in utimensat_sc() argument
74 return ltp_syscall(__NR_utimensat, dirfd, pathname, times, flags); in utimensat_sc()
110 int flags, dirfd, opt, oflag; in main() local
121 dirfd = AT_FDCWD; in main()
154 dirfd = open(dirfdPath, oflag); in main()
155 if (dirfd == -1) in main()
224 printf("dirfd is %d\n", dirfd); in main()
238 if (utimensat_sc(dirfd, pathname, tsp, flags) == -1) { in main()
/external/ltp/testcases/kernel/syscalls/fstatat/
Dfstatat01.c63 int fstatat(int dirfd, const char *filename, struct stat64 *statbuf, int flags) in fstatat() argument
65 return ltp_syscall(__NR_fstatat64, dirfd, filename, statbuf, flags); in fstatat()
68 int fstatat(int dirfd, const char *filename, struct stat *statbuf, int flags) in fstatat() argument
70 return ltp_syscall(__NR_newfstatat, dirfd, filename, statbuf, flags); in fstatat()
73 int fstatat(int dirfd, const char *filename, struct stat *statbuf, int flags) in fstatat() argument
75 return ltp_syscall(__NR_fstatat, dirfd, filename, statbuf, flags); in fstatat()
/external/toybox/toys/other/
Dlspci.c44 int dirfd; local
50 if (-1 == (dirfd = openat(dirtree_parentfd(new), new->name, O_RDONLY)))
55 readlinkat0(dirfd, "driver", driver, sizeof(driver));
61 if (-1 == (fd = openat(dirfd, *fields, O_RDONLY))) {
62 close(dirfd);
72 close(dirfd);
/external/toybox/lib/
Ddirtree.c36 int fd = parent ? parent->dirfd : AT_FDCWD, in dirtree_add_node()
108 return node->parent ? node->parent->dirfd : AT_FDCWD; in dirtree_parentfd()
142 int (*callback)(struct dirtree *node), int dirfd, int flags) in dirtree_recurse() argument
149 if (AT_FDCWD == (node->dirfd = dirfd)) dir = opendir("."); in dirtree_recurse()
150 else if (node->dirfd != -1) dir = fdopendir(node->dirfd); in dirtree_recurse()
157 close(node->dirfd); in dirtree_recurse()
186 node->dirfd = -1; in dirtree_recurse()
/external/python/cffi/demo/
Dreaddir2.py14 dirfd = lib.openat(basefd, path, 0)
15 if dirfd < 0:
18 dir = lib.fdopendir(dirfd)
30 walk(dirfd, name)
Dreaddir.py14 dirfd = lib.openat(basefd, path, 0)
15 if dirfd < 0:
18 dir = lib.fdopendir(dirfd)
30 walk(dirfd, name)
Dreaddir_ctypes.py48 dirfd = openat(basefd, path, 0)
49 if dirfd < 0:
52 dir = fdopendir(dirfd)
64 walk(dirfd, name)
/external/rust/crates/nix/test/
Dtest_unistd.rs139 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); in test_mkfifoat() localVariable
142 mkfifoat(Some(dirfd), mkfifoat_name, Mode::S_IRUSR).unwrap(); in test_mkfifoat()
144 let stats = stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); in test_mkfifoat()
167 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); in test_mkfifoat_directory() localVariable
169 stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap(); in test_mkfifoat_directory()
171 assert!(!mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_ok()); in test_mkfifoat_directory()
497 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); in test_fchownat() localVariable
499 fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); in test_fchownat()
770 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); in test_symlinkat() localVariable
773 symlinkat(target, Some(dirfd), linkpath).unwrap(); in test_symlinkat()
[all …]
Dtest_stat.rs115 let dirfd = fcntl::open(tempdir.path(), in test_fstatat() localVariable
119 let result = stat::fstatat(dirfd.unwrap(), in test_fstatat()
181 let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); in test_fchmodat() localVariable
186 fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink).unwrap(); in test_fchmodat()
273 let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); in test_utimensat() localVariable
275 utimensat(Some(dirfd), filename, &TimeSpec::seconds(12345), &TimeSpec::seconds(678), in test_utimensat()
291 let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); in test_mkdirat_success_path() localVariable
292 assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); in test_mkdirat_success_path()
302 let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); in test_mkdirat_success_mode() localVariable
303 assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); in test_mkdirat_success_mode()
[all …]
/external/linux-kselftest/tools/testing/selftests/proc/
Dread.c45 fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK); in f_reg()
58 fd = openat(dirfd(d), filename, O_WRONLY); in f_reg_write()
71 rv = readlinkat(dirfd(d), filename, buf, sizeof(buf)); in f_lnk()
107 fd = openat(dirfd(d), de->d_name, O_DIRECTORY|O_RDONLY); in f()
135 if (fstatfs(dirfd(d), &sfs) == -1) { in main()
/external/llvm-project/clang/test/Analysis/
Dstd-c-library-functions-POSIX.c127 int faccessat(int dirfd, const char *pathname, int mode, int flags);
144 int dirfd(DIR *dirp);
157 int mkdirat(int dirfd, const char *pathname, mode_t mode);
160 int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
162 int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
166 int fchownat(int dirfd, const char *pathname, uid_t owner, gid_t group, int flags);
257 int utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags);
/external/rust/crates/libc/src/
Dwasi.rs493 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; in dirfd() function
497 pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int; in openat()
499 dirfd: ::c_int, in fstatat()
511 pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; in mkdirat()
513 dirfd: ::c_int, in readlinkat()
529 pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int; in unlinkat()
585 dirfd: ::c_int, in faccessat()
598 dirfd: ::c_int, in utimensat()
624 pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int; in __wasilibc_nocwd___wasilibc_unlinkat()
625 pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int; in __wasilibc_nocwd___wasilibc_rmdirat()
[all …]
/external/ltp/include/lapi/
Dmkdirat.h27 int mkdirat(int dirfd, const char *dirname, int mode) in mkdirat() argument
29 return ltp_syscall(__NR_mkdirat, dirfd, dirname, mode); in mkdirat()
Dreadlinkat.h27 int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) in readlinkat() argument
29 return ltp_syscall(__NR_readlinkat, dirfd, pathname, buf, bufsiz); in readlinkat()
/external/rust/crates/nix/src/sys/
Dstat.rs115 pub fn fstatat<P: ?Sized + NixPath>(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result<FileStat> { in fstatat()
118 unsafe { libc::fstatat(dirfd, cstr.as_ptr(), dst.as_mut_ptr(), f.bits() as libc::c_int) } in fstatat()
162 dirfd: Option<RawFd>, in fchmodat()
174 at_rawfd(dirfd), in fchmodat()
266 dirfd: Option<RawFd>, in utimensat()
280 at_rawfd(dirfd), in utimensat()
/external/ltp/testcases/kernel/syscalls/openat/
Dopenat.h29 int openat(int dirfd, const char *pathname, int flags, mode_t mode) in openat() argument
31 return ltp_syscall(__NR_openat, dirfd, pathname, flags, mode); in openat()

123456