bin/cp/utils.c
191
to_fd = openat(to.dir, to.path,
bin/cp/utils.c
195
to_fd = openat(to.dir, to.path,
bin/cp/utils.c
469
openat(to.dir, dest_dir, O_DIRECTORY, AT_RESOLVE_BENEATH);
cddl/compat/opensolaris/include/fcntl.h
36
#define openat64(...) openat(__VA_ARGS__)
lib/libc/sys/creat.c
46
return (INTERPOS_SYS(openat, AT_FDCWD, path,
lib/libc/sys/open.c
51
return (INTERPOS_SYS(openat, AT_FDCWD, path, flags, mode));
lib/libc/sys/openat.c
37
__sym_compat(openat, __impl_openat, FBSD_1.1);
lib/libc/sys/openat.c
38
__weak_reference(openat, __impl_openat);
lib/libc/sys/openat.c
39
__sym_default(openat, openat, FBSD_1.2);
lib/libc/sys/openat.c
55
return (INTERPOS_SYS(openat, fd, path, flags, mode));
lib/libc/tests/gen/dir2_test.c
149
fd = openat(dd, filename, O_WRONLY | O_CREAT, 0600);
lib/libc/tests/gen/dir2_test.c
72
fd = openat(dd, filename, O_WRONLY | O_CREAT, 0600);
lib/libc/tests/stdtime/detect_tz_changes_test.c
77
ATF_REQUIRE((sfd = openat(zfd, tzn, O_RDONLY)) >= 0);
lib/libpam/modules/pam_xdg/pam_xdg.c
156
session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE);
lib/libpam/modules/pam_xdg/pam_xdg.c
195
dirfd = openat(fd, dp->d_name, 0);
lib/libpam/modules/pam_xdg/pam_xdg.c
263
rt_dir = openat(rt_dir_prefix, user, O_DIRECTORY | O_NOFOLLOW);
lib/libpam/modules/pam_xdg/pam_xdg.c
279
session_file = openat(rt_dir_prefix, xdg_session_file, 0);
lib/libpam/modules/pam_xdg/pam_xdg.c
93
rt_dir = openat(rt_dir_prefix, user, O_DIRECTORY | O_NOFOLLOW);
lib/libsys/interposing_table.c
48
SLOT(openat, __sys_openat),
lib/libthr/thread/thr_syscalls.c
674
SLOT(openat);
lib/libutil/flopen.c
72
if ((fd = openat(dirfd, path, flags, mode)) == -1)
lib/libutil/pidfile.c
81
fd = openat(dirfd, filename, O_RDONLY | O_CLOEXEC);
libexec/pkg-serve/pkg-serve.c
151
if ((ffd = openat(fd, file, O_RDONLY | O_RESOLVE_BENEATH)) == -1) {
libexec/rtld-elf/tests/common.c
78
return openat(parent, name, O_RDONLY | O_DIRECTORY);
libexec/rtld-elf/tests/ld_library_pathfds.c
163
(dp->binary = openat(dp->testdir, TARGET_ELF_NAME, O_RDONLY)) >= 0);
libexec/rtld-elf/tests/ld_preload_fds.c
43
binaryfd = openat(testdir, TARGET_ELF_NAME, O_RDONLY);
libexec/rtld-elf/tests/ld_preload_fds.c
45
libraryfd = openat(testdir, TARGET_LIBRARY, O_RDONLY);
sbin/savecore/savecore.c
1163
fdcore = openat(savedirfd, corename, O_WRONLY | O_CREAT | O_TRUNC,
sbin/savecore/savecore.c
149
fd = openat(dirfd, path, flags, mode);
sbin/savecore/savecore.c
293
fd = openat(savedirfd, keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
stand/userboot/test/test.c
202
comp_fd = openat(dir_fd, component, O_RDONLY);
sys/sys/fcntl.h
418
int openat(int, const char *, int, ...);
tests/sys/audit/open.c
115
ATF_REQUIRE((filedesc2 = openat(AT_FDCWD, path, flag)) != -1); \
tests/sys/audit/open.c
135
ATF_REQUIRE_EQ(-1, openat(AT_FDCWD, errpath, flag)); \
tests/sys/capsicum/bindat_connectat.c
60
return (openat(rootfd, path + 1, flags, mode));
tests/sys/capsicum/bindat_connectat.c
62
return (openat(AT_FDCWD, path, flags, mode));
tests/sys/capsicum/capability-fd.cc
270
int file = openat(dir, "cap_openat_testfile", O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
275
int new_file = openat(dir, "../dev/null", O_RDONLY);
tests/sys/capsicum/capability-fd.cc
278
new_file = openat(dir, "..", O_RDONLY);
tests/sys/capsicum/capability-fd.cc
281
new_file = openat(dir, "/dev/null", O_RDONLY);
tests/sys/capsicum/capability-fd.cc
284
new_file = openat(dir, "/", O_RDONLY);
tests/sys/capsicum/capability-fd.cc
343
int file = openat(dir, filename, O_WRONLY|O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
349
file = openat(cap_dir, filename, O_RDONLY);
tests/sys/capsicum/capability-fd.cc
358
file = openat(cap_dir, filename, O_WRONLY|O_APPEND);
tests/sys/capsicum/capability-fd.cc
648
int rc = openat(dfd_cap, "cap_create", O_CREAT | O_RDONLY, 0600);
tests/sys/capsicum/capability-fd.cc
654
rc = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY | O_APPEND, 0600);
tests/sys/capsicum/capability-fd.cc
660
rc = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR | O_APPEND, 0600);
tests/sys/capsicum/capability-fd.cc
667
rc = openat(dirfd, "cap_faccess", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
674
rc = openat(dirfd, "cap_fsync", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
677
rc = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY);
tests/sys/capsicum/capability-fd.cc
682
rc = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY | O_APPEND);
tests/sys/capsicum/capability-fd.cc
687
rc = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR | O_APPEND);
tests/sys/capsicum/capability-fd.cc
692
rc = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY);
tests/sys/capsicum/capability-fd.cc
697
rc = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY | O_APPEND);
tests/sys/capsicum/capability-fd.cc
702
rc = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR | O_APPEND);
tests/sys/capsicum/capability-fd.cc
709
rc = openat(dirfd, "cap_ftruncate", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
712
rc = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDONLY);
tests/sys/capsicum/capability-fd.cc
717
rc = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_WRONLY);
tests/sys/capsicum/capability-fd.cc
722
rc = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDWR);
tests/sys/capsicum/capability-fd.cc
729
rc = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY, 0600);
tests/sys/capsicum/capability-fd.cc
735
rc = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR, 0600);
tests/sys/capsicum/capability-fd.cc
742
rc = openat(dirfd, "cap_fsync", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
745
rc = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY);
tests/sys/capsicum/capability-fd.cc
751
rc = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR);
tests/sys/capsicum/capability-fd.cc
757
rc = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY);
tests/sys/capsicum/capability-fd.cc
763
rc = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR);
tests/sys/capsicum/capability-fd.cc
771
rc = openat(dirfd, "cap_chflagsat", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
778
rc = openat(dirfd, "cap_fchownat", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
785
rc = openat(dirfd, "cap_fchmodat", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
792
rc = openat(dirfd, "cap_fstatat", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
800
rc = openat(dirfd, "cap_futimesat", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
810
rc = openat(dirfd, "cap_linkat_src", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
851
rc = openat(dirfd, "cap_renameat_src", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
863
rc = openat(dirfd, "cap_renameat_src", O_CREAT, 0600);
tests/sys/capsicum/capability-fd.cc
882
rc = openat(dirfd, "cap_unlinkat", O_CREAT, 0600);
tests/sys/capsicum/capmode.cc
401
int file = openat(dfd, "testfile", O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/capmode.cc
463
int file = openat(dfd, "testfile", O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/capmode.cc
474
EXPECT_CAPMODE(openat(AT_FDCWD, "testfile", O_RDONLY));
tests/sys/capsicum/capsicum-test.h
169
SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \
tests/sys/capsicum/capsicum-test.h
170
const int result = openat((fd), (path), (flags)); \
tests/sys/capsicum/capsicum-test.h
181
SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \
tests/sys/capsicum/capsicum-test.h
182
const int result = openat((fd), (path), (flags)); \
tests/sys/capsicum/copy_file_range.cc
56
int fd = openat(wd_, INFILE, O_RDONLY);
tests/sys/capsicum/copy_file_range.cc
62
int fd = openat(wd_, OUTFILE, O_WRONLY);
tests/sys/capsicum/linux.cc
1366
int fd = openat(dir, "cap_openbyhandle_testfile", O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/openat.cc
109
EXPECT_OPEN_OK(openat(etc, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
110
EXPECT_OPEN_OK(openat(etc_cap_ro, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
111
EXPECT_OPEN_OK(openat(etc_cap_base, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
114
EXPECT_NOTCAPABLE(openat(etc_cap, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
117
EXPECT_CAPMODE(openat(AT_FDCWD, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
126
fd = openat(etc, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
130
fd = openat(etc_cap_base, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
136
fd = openat(etc_cap_ro, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
222
cwd_ = openat(AT_FDCWD, ".", O_RDONLY);
tests/sys/capsicum/openat.cc
255
EXPECT_OPEN_OK(openat(dir_fd_, "topfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
256
EXPECT_OPEN_OK(openat(dir_fd_, "subdir/bottomfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
257
EXPECT_OPEN_OK(openat(sub_fd_, "bottomfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
258
EXPECT_OPEN_OK(openat(sub_fd_, ".", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
266
EXPECT_OPEN_OK(openat(dir_fd_, "subdir/../topfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
273
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
274
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
281
EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.samedir/topfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
282
EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.down/bottomfile", O_RDONLY|oflag));
tests/sys/capsicum/openat.cc
290
EXPECT_SYSCALL_FAIL(E_TOO_MANY_LINKS, openat(dir_fd_, "symlink.samedir", O_RDONLY|O_NOFOLLOW|oflag));
tests/sys/capsicum/openat.cc
291
EXPECT_SYSCALL_FAIL(E_TOO_MANY_LINKS, openat(dir_fd_, "symlink.down", O_RDONLY|O_NOFOLLOW|oflag));
tests/sys/capsicum/openat.cc
302
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY));
tests/sys/capsicum/openat.cc
303
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY));
tests/sys/capsicum/openat.cc
304
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.absolute_out", O_RDONLY));
tests/sys/capsicum/openat.cc
305
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_in", O_RDONLY));
tests/sys/capsicum/openat.cc
306
EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_out", O_RDONLY));
tests/sys/capsicum/openat.cc
307
EXPECT_OPEN_OK(openat(sub_fd_, "symlink.absolute_in", O_RDONLY));
tests/sys/capsicum/openat.cc
308
EXPECT_OPEN_OK(openat(sub_fd_, "symlink.up", O_RDONLY));
tests/sys/capsicum/openat.cc
325
EXPECT_CAPMODE(openat(AT_FDCWD, "topfile", O_RDONLY));
tests/sys/capsicum/openat.cc
326
EXPECT_CAPMODE(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY));
tests/sys/capsicum/openat.cc
327
EXPECT_CAPMODE(openat(AT_FDCWD, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
338
EXPECT_OPEN_OK(openat(AT_FDCWD, "topfile", O_RDONLY|O_RESOLVE_BENEATH));
tests/sys/capsicum/openat.cc
339
EXPECT_OPEN_OK(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY|O_RESOLVE_BENEATH));
tests/sys/capsicum/openat.cc
68
EXPECT_OPEN_OK(openat(etc, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
69
EXPECT_OPEN_OK(openat(AT_FDCWD, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
70
EXPECT_OPEN_OK(openat(etc, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
71
EXPECT_OPEN_OK(openat(etc, "../etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
75
EXPECT_OPEN_OK(openat(etc_cap_ro, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
76
EXPECT_OPEN_OK(openat(etc_cap_base, "passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
80
EXPECT_OPEN_OK(openat(etc_cap_ro, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
81
EXPECT_OPEN_OK(openat(etc_cap_base, "/etc/passwd", O_RDONLY));
tests/sys/capsicum/openat.cc
87
int fd = openat(etc_cap_base, "passwd", O_RDONLY);
tests/sys/cddl/zfs/bin/mktree.c
179
if ((afd = openat(fd, "xattr", O_CREAT | O_RDWR | O_XATTR, 0777)) < 0) {
tests/sys/file/path_test.c
231
dfd = openat(pathdfd, "", O_DIRECTORY | O_EMPTY_PATH);
tests/sys/file/path_test.c
240
dfd = openat(pathdfd, "", O_DIRECTORY | O_EMPTY_PATH);
tests/sys/file/path_test.c
249
dfd = openat(pathdfd, "", O_DIRECTORY | O_EMPTY_PATH);
tests/sys/file/path_test.c
255
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH);
tests/sys/file/path_test.c
261
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH | O_APPEND);
tests/sys/file/path_test.c
270
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH);
tests/sys/file/path_test.c
278
fd = openat(pathfd, "", O_RDONLY | O_EMPTY_PATH);
tests/sys/file/path_test.c
345
fd = openat(pathfd, "test", O_RDWR | O_CREAT, 0600);
tests/sys/file/path_test.c
356
openat(pathfd, "test2", O_RDWR | O_CREAT, 0600) < 0);
tests/sys/file/path_test.c
384
openat(pathfd, "test2", O_RDWR | O_CREAT, 0600) < 0);
tests/sys/file/path_test.c
972
ATF_REQUIRE_ERRNO(EOPNOTSUPP, openat(pathfd, "", O_EMPTY_PATH) == -1);
tests/sys/fs/fusefs/allow_other.cc
243
fd = openat(dfd, RELPATH2, O_RDONLY);
tests/sys/kern/inotify_test.c
353
fd = openat(dfd, "file", O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
372
fd = openat(dfd, "file2", O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
423
fd = openat(dfd, name, O_CREAT | O_RDWR, 0644);
tests/sys/kern/ktrace_test.c
440
CHILD_REQUIRE(close(openat(AT_FDCWD, "ktrace.out",
tests/sys/kern/ktrace_test.c
445
CHILD_REQUIRE(close(openat(-1, "/", O_RDONLY)) != -1);
tests/sys/kern/tty/test_sti.c
298
wotty = openat(STDIN_FILENO, "", O_EMPTY_PATH | O_WRONLY);
tests/sys/kern/tty/test_sti.c
301
rotty = openat(STDIN_FILENO, "", O_EMPTY_PATH | O_RDONLY);
tests/sys/kern/unix_passfd_test.c
1149
fd = openat(dfd, "../c", O_RDONLY | O_DIRECTORY);
tests/sys/kern/unix_passfd_test.c
1156
fd = openat(dfd, "c", O_RDONLY | O_DIRECTORY);
tests/sys/kern/unix_passfd_test.c
1160
dfd2 = openat(dfd, "", O_EMPTY_PATH | O_RDONLY | O_DIRECTORY);
tests/sys/vfs/lookup_cap_dotdot.c
100
ATF_REQUIRE(openat(dirfd, "../testdir/d1/f1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
101
ATF_REQUIRE(openat(dirfd, "lup/f1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
102
ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
103
ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
105
ATF_REQUIRE(openat(dirfd, abspath, O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
127
ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s",
tests/sys/vfs/lookup_cap_dotdot.c
150
ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
151
ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
152
ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
153
ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
170
openat(dirfd, "does-not-exist", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
172
openat(dirfd, "l3/does-not-exist", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
194
ATF_REQUIRE_ERRNO(ECAPMODE, openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
197
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
198
ATF_REQUIRE((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
200
openat(subdirfd, "../../f1", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
203
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, abspath, O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
206
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "lup/f1", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
228
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
229
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "d1/../..", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
230
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0);
tests/sys/vfs/lookup_cap_dotdot.c
248
dfd2 = openat(dfd, "..", O_DIRECTORY);
tests/sys/vfs/lookup_cap_dotdot.c
254
dfd2 = openat(dfd, "..", O_DIRECTORY);
tests/sys/vfs/lookup_cap_dotdot.c
255
ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dfd, "..", O_DIRECTORY));
tests/sys/vfs/lookup_cap_dotdot.c
47
ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
tests/sys/vfs/lookup_cap_dotdot.c
96
ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
97
ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
98
ATF_REQUIRE(openat(dirfd, "l3/f3", O_RDONLY) >= 0);
tests/sys/vfs/lookup_cap_dotdot.c
99
ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
tools/regression/security/cap_test/cap_test_capabilities.c
184
ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDONLY, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
185
CHECK_RESULT(openat(O_CREATE | O_RDONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
189
ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY | O_APPEND,
tools/regression/security/cap_test/cap_test_capabilities.c
191
CHECK_RESULT(openat(O_CREATE | O_WRONLY | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
195
ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR | O_APPEND, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
196
CHECK_RESULT(openat(O_CREATE | O_RDWR | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
204
ret = openat(dirfd, "cap_fsync", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
207
ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
208
CHECK_RESULT(openat(O_FSYNC | O_RDONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
211
ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY | O_APPEND);
tools/regression/security/cap_test/cap_test_capabilities.c
212
CHECK_RESULT(openat(O_FSYNC | O_WRONLY | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
215
ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR | O_APPEND);
tools/regression/security/cap_test/cap_test_capabilities.c
216
CHECK_RESULT(openat(O_FSYNC | O_RDWR | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
219
ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
220
CHECK_RESULT(openat(O_SYNC | O_RDONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
223
ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY | O_APPEND);
tools/regression/security/cap_test/cap_test_capabilities.c
224
CHECK_RESULT(openat(O_SYNC | O_WRONLY | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
227
ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR | O_APPEND);
tools/regression/security/cap_test/cap_test_capabilities.c
228
CHECK_RESULT(openat(O_SYNC | O_RDWR | O_APPEND),
tools/regression/security/cap_test/cap_test_capabilities.c
236
ret = openat(dirfd, "cap_ftruncate", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
239
ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
240
CHECK_RESULT(openat(O_TRUNC | O_RDONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
243
ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_WRONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
244
CHECK_RESULT(openat(O_TRUNC | O_WRONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
247
ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDWR);
tools/regression/security/cap_test/cap_test_capabilities.c
248
CHECK_RESULT(openat(O_TRUNC | O_RDWR),
tools/regression/security/cap_test/cap_test_capabilities.c
253
ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
254
CHECK_RESULT(openat(O_CREATE | O_WRONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
258
ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
259
CHECK_RESULT(openat(O_CREATE | O_RDWR),
tools/regression/security/cap_test/cap_test_capabilities.c
265
ret = openat(dirfd, "cap_fsync", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
268
ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
269
CHECK_RESULT(openat(O_FSYNC | O_WRONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
272
ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR);
tools/regression/security/cap_test/cap_test_capabilities.c
273
CHECK_RESULT(openat(O_FSYNC | O_RDWR),
tools/regression/security/cap_test/cap_test_capabilities.c
276
ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY);
tools/regression/security/cap_test/cap_test_capabilities.c
277
CHECK_RESULT(openat(O_SYNC | O_WRONLY),
tools/regression/security/cap_test/cap_test_capabilities.c
280
ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR);
tools/regression/security/cap_test/cap_test_capabilities.c
281
CHECK_RESULT(openat(O_SYNC | O_RDWR),
tools/regression/security/cap_test/cap_test_capabilities.c
293
ret = openat(dirfd, "cap_chflagsat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
303
ret = openat(dirfd, "cap_fchownat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
313
ret = openat(dirfd, "cap_fchmodat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
330
ret = openat(dirfd, "cap_fstatat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
346
ret = openat(dirfd, "cap_futimesat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
353
ret = openat(dirfd, "cap_linkat_src", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_capabilities.c
379
ret = openat(dirfd, "cap_unlinkat", O_CREAT, 0600);
tools/regression/security/cap_test/cap_test_relative.c
100
REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
113
CHECK_SYSCALL_SUCCEEDS(openat, etc, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
114
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_ro, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
115
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_base, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
116
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
121
CHECK_NOTCAPABLE(openat, etc_cap, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
126
CHECK_CAPMODE(openat, AT_FDCWD, "/etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
127
CHECK_NOTCAPABLE(openat, etc, "/etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
132
CHECK_NOTCAPABLE(openat, etc, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
133
CHECK_NOTCAPABLE(openat, etc_cap_ro, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
134
CHECK_NOTCAPABLE(openat, etc_cap_base, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
136
REQUIRE(fd = openat(etc, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
142
REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
71
CHECK_SYSCALL_SUCCEEDS(openat, etc, "/etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
72
CHECK_SYSCALL_SUCCEEDS(openat, AT_FDCWD, "/etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
73
CHECK_SYSCALL_SUCCEEDS(openat, etc, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
74
CHECK_SYSCALL_SUCCEEDS(openat, etc, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
81
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_ro, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
82
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_base, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
83
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
85
CHECK_NOTCAPABLE(openat, etc_cap_ro, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
86
CHECK_NOTCAPABLE(openat, etc_cap_base, "../etc/passwd", O_RDONLY);
tools/regression/security/cap_test/cap_test_relative.c
93
CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "../etc/passwd", O_RDONLY);
tools/test/stress2/testcases/openat/openat.c
124
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
tools/test/stress2/testcases/openat/openat.c
146
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
tools/test/stress2/testcases/openat/openat.c
171
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
usr.bin/bsdiff/bspatch/bspatch.c
146
if ((newfd = openat(dirfd, newfile,
usr.bin/calendar/io.c
135
if ((fd = openat(cwdfd, file, O_RDONLY)) != -1) {
usr.bin/runat/runat.c
88
nameddir_fd = openat(file_fd, ".", O_RDONLY | O_CLOEXEC | O_NAMEDATTR,
usr.bin/rwho/rwho.c
132
f = openat(dfd, dp->d_name, O_RDONLY);
usr.bin/write/write.c
288
fd = openat(devfd, tty, O_WRONLY);
usr.sbin/bhyve/gdb.c
1822
fd = openat(xml_dfd, path, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/bhyve/snapshot.c
1234
kdata_fd = openat(fddir, kdata_filename, O_WRONLY | O_CREAT | O_TRUNC, 0700);
usr.sbin/bhyve/snapshot.c
1241
fd_checkpoint = openat(fddir, checkpoint_file, O_RDWR | O_CREAT | O_TRUNC, 0700);
usr.sbin/bhyve/snapshot.c
1255
fd_meta = openat(fddir, meta_filename, O_WRONLY | O_CREAT | O_TRUNC, 0700);
usr.sbin/bhyveload/bhyveload.c
187
fd = openat(hostbase_fd, filename, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/bhyveload/bhyveload.c
777
fd = openat(bootfd, loader, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/certctl/certctl.c
511
fd = openat(d, tmppath,
usr.sbin/certctl/certctl.c
524
fd = openat(d, tmppath,
usr.sbin/certctl/certctl.c
596
fd = openat(d, tmpfile, O_WRONLY | O_CREAT | O_EXCL, mode);
usr.sbin/cpucontrol/cpucontrol.c
369
fwfd = openat(fwdfd, fname, O_RDONLY);
usr.sbin/makefs/zfs/fs.c
299
fd = openat(fd, path, flags);
usr.sbin/makefs/zfs/fs.c
313
return (openat(fd, path, flags));
usr.sbin/pw/cpdir.c
126
if ((srcfd = openat(skelfd, e->d_name, O_RDONLY)) == -1)
usr.sbin/pw/cpdir.c
128
destfd = openat(rootfd, path, O_RDWR | O_CREAT | O_EXCL,
usr.sbin/pw/cpdir.c
99
fd = openat(skelfd, e->d_name, O_DIRECTORY);
usr.sbin/pw/pw_user.c
1489
close(openat(conf.rootfd, path +1, O_RDWR | O_CREAT, 0600));
usr.sbin/pw/pw_user.c
156
skelfd = openat(conf.rootfd, skeldir, O_DIRECTORY|O_CLOEXEC);
usr.sbin/pw/rm_r.c
72
dirfd = openat(rootfd, path, O_DIRECTORY);
usr.sbin/rwhod/rwhod.c
397
whod = openat(dirfd, path, O_WRONLY | O_CREAT, 0644);