Home
last modified time | relevance | path

Searched refs:dir_fd (Results 1 – 25 of 26) sorted by relevance

12

/external/ltp/testcases/kernel/syscalls/mknodat/
Dmknodat02.c57 static int dir_fd; variable
64 int *dir_fd; member
72 { &dir_fd, "tnode4", FIFOMODE, EROFS },
73 { &dir_fd, "tnode5", FREGMODE, EROFS },
74 { &dir_fd, "tnode6", SOCKMODE, EROFS },
136 dir_fd = SAFE_OPEN(cleanup, MNT_POINT, O_DIRECTORY); in setup()
150 int fd = *(tc->dir_fd); in mknodat_verify()
175 if (dir_fd > 0 && close(dir_fd) < 0) in cleanup()
176 tst_resm(TWARN | TERRNO, "close(%d) failed", dir_fd); in cleanup()
Dmknodat01.c52 static int dir_fd, fd; variable
57 int *dir_fd; member
62 {&dir_fd, testfile, 0, 0},
63 {&dir_fd, testfile3, 0, 0},
76 TEST(mknodat(*test->dir_fd, test->name, S_IFREG, dev)); in verify_mknodat()
141 dir_fd = SAFE_OPEN(cleanup, PATHNAME, O_DIRECTORY); in setup()
154 if (dir_fd > 0 && close(dir_fd)) in cleanup()
/external/ltp/testcases/kernel/syscalls/openat/
Dopenat01.c47 static int dir_fd, fd; variable
57 int *dir_fd; member
62 {&dir_fd, TEST_FILE, 0, 0},
63 {&dir_fd, glob_path, 0, 0},
73 TEST(openat(*test->dir_fd, test->pathname, O_RDWR, 0600)); in verify_openat()
125 dir_fd = SAFE_OPEN(cleanup, TEST_DIR, O_DIRECTORY); in setup()
141 if (dir_fd > 0 && close(dir_fd)) in cleanup()
/external/ltp/testcases/kernel/syscalls/readlinkat/
Dreadlinkat01.c45 static int dir_fd, fd; variable
55 int *dir_fd; member
61 {&dir_fd, TEST_SYMLINK, TEST_FILE, sizeof(TEST_FILE)-1, 0},
62 {&dir_fd, abspath, TEST_FILE, sizeof(TEST_FILE)-1, 0},
76 TEST(readlinkat(*test->dir_fd, test->path, buf, sizeof(buf))); in verify_readlinkat()
129 dir_fd = SAFE_OPEN(cleanup, ".", O_DIRECTORY); in setup()
139 if (dir_fd > 0 && close(dir_fd)) in cleanup()
Dreadlinkat02.c44 static int file_fd, dir_fd; variable
52 {&dir_fd, SYMLINK_FILE, 0, EINVAL},
53 {&dir_fd, TEST_FILE, BUFF_SIZE, EINVAL},
55 {&dir_fd, "test_file/test_file", BUFF_SIZE, ENOTDIR},
90 dir_fd = SAFE_OPEN(cleanup, "./", O_RDONLY); in setup()
118 close(dir_fd); in cleanup()
/external/ltp/testcases/kernel/syscalls/mkdirat/
Dmkdirat01.c46 static int dir_fd, fd; variable
51 int *dir_fd; member
56 {&dir_fd, relpath, 0, 0},
57 {&dir_fd, abspath, 0, 0},
68 TEST(mkdirat(*test->dir_fd, test->name, 0600)); in verify_mkdirat()
100 dir_fd = SAFE_OPEN(cleanup, testdir, O_DIRECTORY); in setup_iteration()
105 SAFE_CLOSE(cleanup, dir_fd); in cleanup_iteration()
Dmkdirat02.c32 static int dir_fd; variable
41 {&dir_fd, TEST_DIR, EROFS},
43 {&dir_fd, test_dir, ELOOP},
51 dir_fd = SAFE_OPEN(".", O_DIRECTORY); in setup()
/external/ltp/testcases/kernel/syscalls/fchownat/
Dfchownat01.c46 static int dir_fd; variable
58 {0, 0, 0, &dir_fd, TESTFILE},
61 {-1, EINVAL, 9999, &dir_fd, TESTFILE},
99 dir_fd = SAFE_OPEN(cleanup, "./", O_DIRECTORY); in setup()
134 if (dir_fd > 0) in cleanup()
135 close(dir_fd); in cleanup()
Dfchownat02.c44 static int dir_fd; variable
86 dir_fd = SAFE_OPEN(cleanup, "./", O_DIRECTORY); in setup()
106 TEST(fchownat(dir_fd, TESTFILE_LINK, set_uid, set_gid, in fchownat_verify()
/external/linux-kselftest/tools/testing/selftests/proc/
Dfd-003-kthread.c44 int dir_fd, fd; in kernel_thread_fd() local
48 dir_fd = open(buf, O_RDONLY|O_DIRECTORY); in kernel_thread_fd()
49 if (dir_fd == -1) in kernel_thread_fd()
56 fd = openat(dir_fd, "stat", O_RDONLY); in kernel_thread_fd()
58 close(dir_fd); in kernel_thread_fd()
90 fd = openat(dir_fd, "fd", O_RDONLY|O_DIRECTORY); in kernel_thread_fd()
92 close(dir_fd); in kernel_thread_fd()
/external/ltp/testcases/kernel/syscalls/readdir/
Dreaddir21.c56 static unsigned int dir_fd; variable
71 {&dir_fd, (struct old_linux_dirent *)-1,
112 dir_fd = SAFE_OPEN(cleanup, TEST_DIR4, O_RDONLY | O_DIRECTORY); in setup()
140 if (dir_fd > 0) in cleanup()
141 close(dir_fd); in cleanup()
/external/ltp/testcases/kernel/syscalls/pipe/
Dpipe07.c110 int dir_fd, fd; in record_open_fds() local
116 dir_fd = dirfd(dir); in record_open_fds()
118 if (dir_fd == -1) in record_open_fds()
129 if (fd == dir_fd) in record_open_fds()
/external/python/cpython3/Modules/clinic/
Dposixmodule.c.h34 os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks);
43 int dir_fd = DEFAULT_DIR_FD; in os_stat() local
47 path_converter, &path, FSTATAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks)) { in os_stat()
50 return_value = os_stat_impl(module, &path, dir_fd, follow_symlinks); in os_stat()
72 os_lstat_impl(PyObject *module, path_t *path, int dir_fd);
81 int dir_fd = DEFAULT_DIR_FD; in os_lstat() local
84 path_converter, &path, FSTATAT_DIR_FD_CONVERTER, &dir_fd)) { in os_lstat()
87 return_value = os_lstat_impl(module, &path, dir_fd); in os_lstat()
132 os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
143 int dir_fd = DEFAULT_DIR_FD; in os_access() local
[all …]
/external/python/cpython3/Lib/test/
Dtest_posix.py655 dir_fd=None)
1062 self.assertTrue(posix.access(support.TESTFN, os.R_OK, dir_fd=f))
1072 posix.chmod(support.TESTFN, stat.S_IRUSR | stat.S_IWUSR, dir_fd=f)
1086 posix.chown(support.TESTFN, os.getuid(), os.getgid(), dir_fd=f)
1099 s2 = posix.stat(support.TESTFN, dir_fd=f)
1101 s2 = posix.stat(support.TESTFN, dir_fd=None)
1104 posix.stat, support.TESTFN, dir_fd=posix.getcwd())
1106 posix.stat, support.TESTFN, dir_fd=float(f))
1108 posix.stat, support.TESTFN, dir_fd=10**20)
1117 posix.utime(support.TESTFN, None, dir_fd=f)
[all …]
Dtest_os.py222 dir_fd=None)
229 target_is_directory=False, dir_fd=None)
565 os.utime(name, dir_fd=dirfd, ns=ns)
659 os.utime(self.fname, (5, 5), dir_fd=0)
3615 st = os.stat(entry.name, dir_fd=fd)
3617 st = os.stat(entry.name, dir_fd=fd, follow_symlinks=False)
/external/python/cpython3/Modules/
Dposixmodule.c1163 int dir_fd; in dir_fd_unavailable() local
1164 if (!dir_fd_converter(o, &dir_fd)) in dir_fd_unavailable()
1166 if (dir_fd != DEFAULT_DIR_FD) { in dir_fd_unavailable()
1170 *(int *)p = dir_fd; in dir_fd_unavailable()
1195 path_and_dir_fd_invalid(const char *function_name, path_t *path, int dir_fd) in path_and_dir_fd_invalid() argument
1197 if (!path->wide && (dir_fd != DEFAULT_DIR_FD) in path_and_dir_fd_invalid()
1211 dir_fd_and_fd_invalid(const char *function_name, int dir_fd, int fd) in dir_fd_and_fd_invalid() argument
1213 if ((dir_fd != DEFAULT_DIR_FD) && (fd != -1)) { in dir_fd_and_fd_invalid()
1236 dir_fd_and_follow_symlinks_invalid(const char *function_name, int dir_fd, in dir_fd_and_follow_symlinks_invalid() argument
1239 if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) { in dir_fd_and_follow_symlinks_invalid()
[all …]
/external/python/cpython3/Lib/
Dos.py422 def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=None): argument
460 orig_st = stat(top, follow_symlinks=False, dir_fd=dir_fd)
461 topfd = open(top, O_RDONLY, dir_fd=dir_fd)
505 orig_st = stat(name, dir_fd=topfd, follow_symlinks=False)
510 dirfd = open(name, O_RDONLY, dir_fd=topfd)
Dshutil.py423 dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
431 os.rmdir(entry.name, dir_fd=topfd)
447 os.unlink(entry.name, dir_fd=topfd)
/external/honggfuzz/
Dinput.c187 int dir_fd = open(hfuzz->io.inputDir, O_DIRECTORY | O_RDONLY | O_CLOEXEC); in input_init() local
188 if (dir_fd == -1) { in input_init()
192 if ((hfuzz->io.inputDirPtr = fdopendir(dir_fd)) == NULL) { in input_init()
193 close(dir_fd); in input_init()
/external/python/cpython3/Doc/library/
Dos.rst899 .. function:: open(path, flags, mode=0o777, *, dir_fd=None)
912 <dir_fd>` with the *dir_fd* parameter.
925 The *dir_fd* argument.
1465 If the function also supports *dir_fd* or *follow_symlinks* arguments, it is
1470 * **paths relative to directory descriptors:** If *dir_fd* is not ``None``, it
1473 path is absolute, *dir_fd* is ignored. (For POSIX systems, Python will call
1476 You can check whether or not *dir_fd* is supported on your platform using
1494 .. function:: access(path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)
1506 descriptors <dir_fd>` and :ref:`not following symlinks <follow_symlinks>`.
1544 Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters.
[all …]
Dfunctions.rst1124 The following example uses the :ref:`dir_fd <dir_fd>` parameter of the
1128 >>> dir_fd = os.open('somedir', os.O_RDONLY)
1130 ... return os.open(path, flags, dir_fd=dir_fd)
1135 >>> os.close(dir_fd) # don't leak a file descriptor
/external/u-boot/tools/env/
Dfw_env.c1321 int dir_fd; in flash_io_write() local
1323 dir_fd = open(dname, O_DIRECTORY | O_RDONLY); in flash_io_write()
1324 if (dir_fd == -1) in flash_io_write()
1337 if (dir_fd != -1 && fsync(dir_fd)) in flash_io_write()
1342 if (dir_fd != -1 && close(dir_fd)) in flash_io_write()
/external/libchrome/base/process/
Dlaunch_posix.cc266 const int dir_fd = fd_dir.fd(); in CloseSuperfluousFds() local
288 if (fd == dir_fd) in CloseSuperfluousFds()
/external/minijail/
Dlibminijail.c2363 int dir_fd = dirfd(d); in close_open_fds() local
2384 if (should_close && fd != dir_fd) in close_open_fds()
/external/python/cpython3/Doc/whatsnew/
D3.3.rst1602 - The following functions get new optional *dir_fd* (:ref:`paths relative to
1603 directory descriptors <dir_fd>`) and/or *follow_symlinks* (:ref:`not
1816 which support the new ``dir_fd`` parameter in :func:`os.open` and

12