/freebsd-current/lib/libc/gen/ |
H A D | dirfd.c | 38 dirfd(DIR *dirp) function
|
H A D | scandir.c | 161 scandirat(int dirfd, const char *dirname, struct dirent ***namelist, argument 168 fd = _openat(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
|
/freebsd-current/tests/sys/vfs/ |
H A D | lookup_cap_dotdot.c | 39 static int dirfd = -1; variable 61 ATF_REQUIRE((dirfd = open("testdir", O_RDONLY)) >= 0); 63 ATF_REQUIRE(mkdirat(dirfd, "d1", 0777) == 0); 64 ATF_REQUIRE(mkdirat(dirfd, "d1/d2", 0777) == 0); 65 ATF_REQUIRE(mkdirat(dirfd, "d1/d2/d3", 0777) == 0); 66 touchat(dirfd, "d1/f1"); 67 touchat(dirfd, "d1/d2/f2"); 68 touchat(dirfd, "d1/d2/d3/f3"); 69 ATF_REQUIRE(symlinkat("d1/d2/d3", dirfd, "l3") == 0); 70 ATF_REQUIRE(symlinkat("../testdir/d1", dirfd, "lu [all...] |
/freebsd-current/lib/libc/tests/gen/ |
H A D | dir2_test.c | 53 int i, dirfd; local 61 dirfd = open(tmpdir, O_RDONLY | O_DIRECTORY); 62 ATF_REQUIRE(dirfd > 0); 73 fd = openat(dirfd, filename, O_WRONLY | O_CREAT, 0600); 79 dirp = fdopendir(dirfd); 80 ATF_REQUIRE_MSG(dirfd >= 0, "fdopendir failed"); 129 int i, dirfd; local 138 dirfd = open(tmpdir, O_RDONLY | O_DIRECTORY); 139 ATF_REQUIRE(dirfd > 0); 150 fd = openat(dirfd, filenam [all...] |
/freebsd-current/usr.sbin/pw/ |
H A D | rm_r.c | 61 int dirfd; local 72 dirfd = openat(rootfd, path, O_DIRECTORY); 73 if (dirfd == -1) { 77 d = fdopendir(dirfd); 79 (void)close(dirfd); 86 if (fstatat(dirfd, e->d_name, &st, AT_SYMLINK_NOFOLLOW) != 0) 89 if (rm_r(dirfd, e->d_name, uid) == true) 92 unlinkat(dirfd, e->d_name, 0);
|
/freebsd-current/tools/regression/security/cap_test/ |
H A D | cap_test_capabilities.c | 111 try_file_ops(int filefd, int dirfd, cap_rights_t rights) argument 135 REQUIRE(dfd_cap = cap_new(dirfd, rights)); 188 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); 194 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); 199 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); 204 ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); 231 CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0); 236 ret = openat(dirfd, "cap_ftruncate", O_CREAT, 0600); 251 CHECK(unlinkat(dirfd, "cap_ftruncate", 0) == 0); 257 CHECK(ret == -1 || unlinkat(dirfd, "cap_creat 432 int filefd, dirfd, tmpfd; local [all...] |
/freebsd-current/lib/libutil/ |
H A D | flopen.c | 49 vflopenat(int dirfd, const char *path, int flags, va_list ap) argument 72 if ((fd = openat(dirfd, path, flags, mode)) == -1) 82 if (fstatat(dirfd, path, &sb, 0) == -1) { 136 flopenat(int dirfd, const char *path, int flags, ...) argument 142 ret = vflopenat(dirfd, path, flags, ap);
|
H A D | pidfile.c | 76 pidfile_read_impl(int dirfd, const char *filename, pid_t *pidptr) argument 81 fd = openat(dirfd, filename, O_RDONLY | O_CLOEXEC); 102 pidfile_read(int dirfd, const char *filename, pid_t *pidptr) argument 111 errno = pidfile_read_impl(dirfd, filename, pidptr); 127 int error, fd, dirfd, dirlen, filenamelen; local 159 dirfd = open(pfh->pf_dir, O_CLOEXEC | O_DIRECTORY | O_NONBLOCK); 160 if (dirfd == -1) { 173 fd = flopenat(dirfd, pfh->pf_filename, 180 errno = pidfile_read(dirfd, 187 close(dirfd); [all...] |
/freebsd-current/contrib/netbsd-tests/fs/hfs/ |
H A D | t_pathconvert.c | 36 int dirfd, fd; local 58 RL(dirfd = rump_sys_open("/mp", O_RDONLY)); 60 RL(nbytes = rump_sys_getdents(dirfd, buf, sizeof buf)); 73 RL(rump_sys_close(dirfd));
|
/freebsd-current/crypto/heimdal/lib/roken/ |
H A D | cloexec.c | 64 rk_cloexec(dirfd(d));
|
/freebsd-current/sys/security/audit/ |
H A D | audit.h | 113 void audit_arg_sockaddr(struct thread *td, int dirfd, struct sockaddr *sa); 117 void audit_arg_upath1(struct thread *td, int dirfd, char *upath); 119 void audit_arg_upath2(struct thread *td, int dirfd, char *upath); 302 #define AUDIT_ARG_SOCKADDR(td, dirfd, sa) do { \ 304 audit_arg_sockaddr((td), (dirfd), (sa)); \ 347 #define AUDIT_ARG_UPATH1(td, dirfd, upath) do { \ 349 audit_arg_upath1((td), (dirfd), (upath)); \ 357 #define AUDIT_ARG_UPATH2(td, dirfd, upath) do { \ 359 audit_arg_upath2((td), (dirfd), (upath)); \ 450 #define AUDIT_ARG_SOCKADDR(td, dirfd, s [all...] |
H A D | audit_arg.c | 450 audit_arg_sockaddr(struct thread *td, int dirfd, struct sockaddr *sa) argument 472 if (dirfd != AT_FDCWD) 473 audit_arg_atfd1(dirfd); 474 audit_arg_upath1(td, dirfd, 733 audit_arg_upath(struct thread *td, int dirfd, char *upath, char **pathp) argument 738 audit_canon_path(td, dirfd, upath, *pathp); 742 audit_arg_upath1(struct thread *td, int dirfd, char *upath) argument 750 audit_arg_upath(td, dirfd, upath, &ar->k_ar.ar_arg_upath1); 755 audit_arg_upath2(struct thread *td, int dirfd, char *upath) argument 763 audit_arg_upath(td, dirfd, upat [all...] |
H A D | audit_bsm_klib.c | 494 audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath) argument 510 if (dirfd == AT_FDCWD) { 513 error = fgetvp(td, dirfd, cap_rights_init(&rights), &cdir);
|
/freebsd-current/contrib/capsicum-test/ |
H A D | capability-fd.cc | 678 static void TryDirOps(int dirfd, cap_rights_t rights) { argument 680 int dfd_cap = dup(dirfd); 690 EXPECT_OK(unlinkat(dirfd, "cap_create", 0)); 696 EXPECT_OK(unlinkat(dirfd, "cap_create", 0)); 702 EXPECT_OK(unlinkat(dirfd, "cap_create", 0)); 705 rc = openat(dirfd, "cap_faccess", O_CREAT, 0600); 710 EXPECT_OK(unlinkat(dirfd, "cap_faccess", 0)); 712 rc = openat(dirfd, "cap_fsync", O_CREAT, 0600); 745 EXPECT_OK(unlinkat(dirfd, "cap_fsync", 0)); 747 rc = openat(dirfd, "cap_ftruncat [all...] |
/freebsd-current/tools/build/cross-build/include/linux/ |
H A D | libutil.h | 52 int flopenat(int dirfd, const char *path, int flags, ...);
|
/freebsd-current/usr.bin/bsdiff/bspatch/ |
H A D | bspatch.c | 53 static int dirfd = -1; variable 59 if (dirfd != -1 && newfile != NULL) 60 if (unlinkat(dirfd, newfile, 0)) 140 (dirfd = open(directory, O_DIRECTORY)) < 0) 146 if ((newfd = openat(dirfd, newfile, 165 cap_rights_limit(dirfd, &rights_dir) < 0)
|
/freebsd-current/sys/sys/ |
H A D | namei.h | 213 #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd) \ 214 NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, &cap_no_rights) 215 #define NDINIT_ATRIGHTS(ndp, op, flags, segflg, namep, dirfd, rightsp) \ 216 NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, rightsp) 243 #define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp) \ 254 _ndp->ni_dirfd = dirfd; \
|
/freebsd-current/bin/pax/ |
H A D | tables.c | 69 static int dirfd = -1; /* storage for setting created dir time/mode */ variable 1088 if (dirfd != -1) 1095 if ((dirfd = mkstemp(tempfile)) >= 0) { 1122 if (dirfd < 0) 1129 if ((dblk.npos = lseek(dirfd, 0L, SEEK_CUR)) < 0) { 1142 if ((write(dirfd, name, dblk.nlen) == dblk.nlen) && 1143 (write(dirfd, (char *)&dblk, sizeof(dblk)) == sizeof(dblk))) { 1165 if (dirfd < 0) 1175 if (lseek(dirfd, -((off_t)sizeof(dblk)), SEEK_CUR) < 0) 1177 if (read(dirfd,(cha [all...] |
/freebsd-current/include/ |
H A D | dirent.h | 105 int dirfd(DIR *);
|
/freebsd-current/lib/libpam/modules/pam_xdg/ |
H A D | pam_xdg.c | 189 int dirfd; local 194 dirfd = openat(fd, dp->d_name, 0); 195 remove_dir(dirfd); 196 close(dirfd);
|
/freebsd-current/usr.sbin/makefs/zfs/ |
H A D | fs.c | 152 int dirfd; member in struct:fs_populate_dir 267 *dirfdp = SLIST_FIRST(&arg->dirs)->dirfd; 588 int dirfd; local 608 dirfd = fs_open_can_fail(cur, arg, O_DIRECTORY | O_RDONLY); 611 dirfd = arg->rootdirfd; 628 dir->dirfd = dirfd; 634 fs_build_one(arg->zfs, cur->inode->param, cur->child, dirfd); 693 if (dir->dirfd != -1) 694 eclose(dir->dirfd); 924 fs_build_one(zfs_opt_t *zfs, zfs_dsl_dir_t *dsldir, fsnode *root, int dirfd) argument 1048 fs_build(zfs_opt_t *zfs, int dirfd, fsnode *root) argument [all...] |
/freebsd-current/contrib/openbsm/bin/auditdistd/ |
H A D | trail.c | 162 dfd = dirfd(dirfp); 221 dfd = dirfd(trail->tr_dirfp); 370 dfd = dirfd(trail->tr_dirfp); 447 dfd = dirfd(trail->tr_dirfp); 475 fd = dirfd(trail->tr_dirfp); 519 return (dirfd(trail->tr_dirfp));
|
/freebsd-current/sys/contrib/openzfs/cmd/zed/ |
H A D | zed_file.c | 130 if (fd > maxfd && fd != dirfd(fddir))
|
/freebsd-current/tests/sys/fs/fusefs/ |
H A D | releasedir.cc | 76 dir2 = fdopendir(dup(dirfd(dir)));
|
/freebsd-current/usr.sbin/rwhod/ |
H A D | rwhod.c | 343 int dirfd; local 350 dirfd = open(".", O_RDONLY | O_DIRECTORY); 351 if (dirfd < 0) { 357 if (caph_rights_limit(dirfd, &rights) < 0) { 397 whod = openat(dirfd, path, O_WRONLY | O_CREAT, 0644); 434 (void) close(dirfd);
|