Symbol: O_CLOEXEC
bin/pax/pax.c
233
cwdfd = open(".", O_RDONLY | O_CLOEXEC);
bin/pax/tables.c
679
fd = open(path0, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0600);
bin/pax/tty_subs.c
67
if ((ttyfd = open(DEVTTY, O_RDWR | O_CLOEXEC)) >= 0) {
lib/libarch/alpha/bwx.c
64
mem_fd = open(_PATH_MEM, O_RDWR|O_CLOEXEC);
lib/libarch/alpha/bwx.c
66
mem_fd = open(PATH_APERTURE, O_RDWR|O_CLOEXEC);
lib/libc/asr/asr.c
448
fd = __pledge_open(_PATH_RESCONF, O_RDONLY|O_CLOEXEC);
lib/libc/asr/getaddrinfo_async.c
399
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
lib/libc/asr/gethostnamadr_async.c
290
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
lib/libc/db/btree/bt_open.c
193
if ((t->bt_fd = open(fname, flags | O_CLOEXEC, mode)) < 0)
lib/libc/db/btree/bt_open.c
410
if ((fd = mkostemp(path, O_CLOEXEC)) != -1)
lib/libc/db/hash/hash.c
118
if ((hashp->fp = open(file, flags | O_CLOEXEC, mode)) == -1)
lib/libc/db/hash/hash_page.c
858
if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1) {
lib/libc/gen/authenticate.c
167
if ((fd = open(file, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
1031
if (fd == -1 && (newfd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
163
(sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
290
open(".", O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/gen/fts.c
380
open(".", O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/gen/fts.c
520
if ((fd = open(".", O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/getgrent.c
216
fd = __pledge_open(_PATH_GROUP, O_RDONLY|O_CLOEXEC);
lib/libc/gen/getgrouplist.c
119
fd = __pledge_open(_PATH_NETID, O_RDONLY|O_CLOEXEC);
lib/libc/gen/getpwent.c
964
fd = __pledge_open(_PATH_SMP_DB, O_RDONLY | O_CLOEXEC);
lib/libc/gen/getpwent.c
971
fd = __pledge_open(_PATH_MP_DB, O_RDONLY | O_CLOEXEC);
lib/libc/gen/login_cap.c
120
if ((res = open(_PATH_LOGIN_CONF, O_RDONLY|O_CLOEXEC)) >= 0)
lib/libc/gen/login_cap.c
588
fd = open(rundir, O_RDONLY|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC|O_CLOFORK);
lib/libc/gen/nlist.c
295
fd = open(name, O_RDONLY | O_CLOEXEC);
lib/libc/gen/opendir.c
52
if ((fd = open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) == -1)
lib/libc/gen/popen.c
73
if (pipe2(pdes, O_CLOEXEC) == -1) {
lib/libc/gen/readpassphrase.c
66
(input = output = __pledge_open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) {
lib/libc/gen/scandir.c
163
fd = HIDDEN(openat)(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
lib/libc/gen/shm_open.c
36
(O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC | O_CLOFORK | O_NOFOLLOW)
lib/libc/gen/shm_open.c
60
flags |= O_CLOEXEC | O_NOFOLLOW;
lib/libc/gmon/gmon.c
178
p->dirfd = open(profdir, O_DIRECTORY|O_CLOEXEC, 0);
lib/libc/gmon/gmon.c
375
log = open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664);
lib/libc/hash/helper.c
70
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/net/getprotoent.c
47
int fd = __pledge_open(_PATH_PROTOCOLS, O_RDONLY|O_CLOEXEC);
lib/libc/net/getservent.c
47
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
lib/libc/net/getservent.c
83
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
lib/libc/nls/catopen.c
173
if ((fd = open(path, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/stdio/fdopen.c
75
if ((oflags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC))
lib/libc/stdio/flags.c
84
o |= O_CLOEXEC;
lib/libc/stdio/freopen.c
136
if (dup3(f, wantfd, oflags & O_CLOEXEC) >= 0) {
lib/libc/stdlib/icdb.c
163
if ((fd = open(name, flags | O_CLOEXEC)) == -1)
lib/libc/stdlib/mkstemp.c
24
(O_APPEND | O_CLOEXEC | O_CLOFORK | O_DSYNC | O_RSYNC | O_SYNC)
lib/libc/time/localtime.c
367
return __pledge_open(name, O_RDONLY|O_CLOEXEC);
lib/libcrypto/arc4random/getentropy_aix.c
134
#ifdef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_aix.c
135
flags |= O_CLOEXEC;
lib/libcrypto/arc4random/getentropy_aix.c
143
#ifndef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_hpux.c
138
#ifdef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_hpux.c
139
flags |= O_CLOEXEC;
lib/libcrypto/arc4random/getentropy_hpux.c
147
#ifndef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_linux.c
212
#ifdef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_linux.c
213
flags |= O_CLOEXEC;
lib/libcrypto/arc4random/getentropy_linux.c
221
#ifndef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_osx.c
158
#ifdef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_osx.c
159
flags |= O_CLOEXEC;
lib/libcrypto/arc4random/getentropy_osx.c
167
#ifndef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_solaris.c
164
#ifdef O_CLOEXEC
lib/libcrypto/arc4random/getentropy_solaris.c
165
flags |= O_CLOEXEC;
lib/libcrypto/arc4random/getentropy_solaris.c
173
#ifndef O_CLOEXEC
lib/libcrypto/rand/randfile.c
108
fd = open(file, O_WRONLY|O_CREAT|O_CLOEXEC, 0600);
lib/libfido2/src/hid_unix.c
26
if ((fd = open(path, O_RDWR|O_CLOEXEC)) == -1) {
lib/libfuse/fuse.c
141
if ((fc->fd = open("/dev/fuse0", O_RDWR|O_CLOEXEC)) == -1) {
lib/libkvm/kvm.c
219
flag |= O_CLOEXEC;
lib/libkvm/kvm.c
304
fd = open(uf, O_RDONLY | O_CLOEXEC);
lib/libkvm/kvm.c
306
fd = open(_PATH_KSYMS, O_RDONLY | O_CLOEXEC);
lib/libkvm/kvm.c
309
fd = open(uf, O_RDONLY | O_CLOEXEC);
lib/libsndio/aucat.c
221
fd = open(path, O_RDONLY|O_CLOEXEC);
lib/libsndio/mio_rmidi.c
96
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
lib/libsndio/sio_sun.c
301
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
lib/libsndio/sioctl_sun.c
364
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) < 0) {
lib/libtls/tls_config.c
52
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1) {
lib/libtls/tls_util.c
165
if ((fd = open(name, O_RDONLY|O_CLOEXEC)) == -1)
lib/libutil/check_expire.c
176
pfd = open(_PATH_MASTERPASSWD, O_RDONLY|O_CLOEXEC);
lib/libutil/login.c
50
if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT|O_CLOEXEC, 0644))
lib/libutil/login.c
68
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) >= 0) {
lib/libutil/logout.c
50
if ((fd = open(_PATH_UTMP, O_RDWR|O_CLOEXEC)) == -1)
lib/libutil/logwtmp.c
49
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) == -1)
lib/libutil/passwd.c
103
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
lib/libutil/passwd.c
106
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
lib/libutil/pty.c
49
return (open(PATH_PTMDEV, O_RDWR|O_CLOEXEC));
lib/libutil/readlabel.c
108
fd = open(rpath, O_RDONLY|O_CLOEXEC);
lib/libutil/readlabel.c
113
fd = open(rpath, O_RDONLY|O_CLOEXEC);
lib/libutil/readlabel.c
62
if ((fd = open("/dev/diskmap", O_RDONLY|O_CLOEXEC)) != -1) {
lib/libutil/uucplock.c
130
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) == -1)
lib/libutil/uucplock.c
73
tmpfd = open(lcktmpname, O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664);
lib/libutil/uucplock.c
86
if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) == -1)
lib/libz/gzlib.c
134
#ifdef O_CLOEXEC
lib/libz/gzlib.c
136
oflag |= O_CLOEXEC;
lib/libz/gzlib.c
258
#ifdef O_CLOEXEC
lib/libz/gzlib.c
259
if (oflag & O_CLOEXEC)
lib/libz/gzlib.c
260
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
libexec/ld.so/dir.c
58
if ((fd = _dl_open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) < 0)
libexec/ld.so/library.c
120
libfile = _dl_open(libname, O_RDONLY | O_CLOEXEC);
libexec/ld.so/library_mquery.c
123
libfile = _dl_open(libname, O_RDONLY | O_CLOEXEC);
libexec/ld.so/sod.c
163
if ((hfd = _dl_open(_PATH_LD_HINTS, O_RDONLY | O_CLOEXEC)) < 0) {
libexec/mail.local/mail.local.c
329
if (pipe2(pfd, O_CLOEXEC) == -1) {
regress/lib/libc/sys/t_dup.c
213
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
215
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) != -1);
regress/lib/libc/sys/t_dup.c
220
ATF_REQUIRE_ERRNO(EINVAL, dup3(-1, -1, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
222
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, -1, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
226
ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
229
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
252
res.rlim_cur + 1, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
81
fd = dup3(fd1, fd2, O_CLOEXEC);
regress/lib/libc/sys/t_pipe2.c
134
err = pipe2(filedes, O_CLOEXEC);
regress/lib/libc/sys/t_pipe2.c
159
run(O_CLOEXEC);
regress/lib/libc/sys/t_pipe2.c
65
if (flags & O_CLOEXEC) {
regress/sys/kern/kqueue/kqueue-exec.c
65
kq = kqueue1(cloexec ? O_CLOEXEC : 0);
regress/sys/kern/pledge/filedescriptor/dup3.c
27
if (dup3(fdpre, 5, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
29
if (dup3(fdpost, 6, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
31
if (dup3(fdpre, 7, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
33
if (dup3(fdpost, 7, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
35
if (dup3(fdpost, 8, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
37
if (dup3(fdpre, 8, O_CLOEXEC) == -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
41
if (dup3(9, 9, O_CLOEXEC) != -1)
regress/sys/kern/pledge/filedescriptor/dup3.c
45
if (dup3(10, 10, O_CLOEXEC) != -1)
sbin/dhcpleased/bpf.c
138
if ((bpffd = open("/dev/bpf", O_RDWR | O_CLOEXEC | O_NONBLOCK)) == -1)
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1601
fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_atomic_uapi.c
1184
fence_state->fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_linux.c
2716
cloexec = (flags & O_CLOEXEC) ? UF_EXCLOSE : 0;
sys/dev/pci/drm/drm_linux.c
3273
KASSERT((flags & O_CLOEXEC) != 0);
sys/dev/pci/drm/drm_syncobj.c
693
fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_syncobj.c
801
int fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/i915/gem/i915_gem_execbuffer.c
3447
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/i915/gem/selftests/mock_dmabuf.c
119
exp_info.flags = O_CLOEXEC;
sys/dev/pci/drm/i915/i915_perf.c
3938
f_flags |= O_CLOEXEC;
sys/dev/pci/drm/include/uapi/drm/drm.h
919
#define DRM_CLOEXEC O_CLOEXEC
sys/kern/kern_descrip.c
340
if (SCARG(uap, flags) & ~(O_CLOEXEC | O_CLOFORK))
sys/kern/kern_descrip.c
390
if (flags & O_CLOEXEC)
sys/kern/kern_event.c
1181
cloexec = (flags & O_CLOEXEC) ? UF_EXCLOSE : 0;
sys/kern/kern_event.c
1218
if (SCARG(uap, flags) & ~(O_CLOEXEC | FNONBLOCK))
sys/kern/sys_pipe.c
165
if (SCARG(uap, flags) & ~(O_CLOEXEC | O_CLOFORK | FNONBLOCK))
sys/kern/sys_pipe.c
180
fdflags = ((flags & O_CLOEXEC) ? UF_EXCLOSE : 0)
sys/kern/vfs_syscalls.c
1119
fdflags = ((oflags & O_CLOEXEC) ? UF_EXCLOSE : 0)
sys/kern/vfs_syscalls.c
1256
(oflags & (O_CLOEXEC | O_CLOFORK));
sys/kern/vfs_syscalls.c
1258
fdflags = ((oflags & O_CLOEXEC) ? UF_EXCLOSE : 0)
sys/kern/vfs_syscalls.c
1395
fdflags = ((flags & O_CLOEXEC) ? UF_EXCLOSE : 0)
usr.bin/chpass/chpass.c
133
dfd = mkostemp(tempname, O_CLOEXEC);
usr.bin/chpass/chpass.c
208
pfd = open(_PATH_MASTERPASSWD, O_RDONLY|O_CLOEXEC);
usr.bin/mail/lex.c
127
if ((fd = mkostemp(tempname, O_CLOEXEC)) == -1 ||
usr.bin/mail/names.c
246
image = open(tempname, O_RDWR | O_CLOEXEC);
usr.bin/passwd/local_passwd.c
155
pfd = open(_PATH_MASTERPASSWD, O_RDONLY | O_CLOEXEC);
usr.bin/rsync/mktemp.c
65
#define MKOTEMP_FLAGS (O_APPEND | O_CLOEXEC | O_DSYNC | O_RSYNC | O_SYNC)
usr.bin/usbhidaction/usbhidaction.c
135
fd = open(dev, O_RDWR | O_CLOEXEC);
usr.sbin/apmd/apmd.c
521
if ((ctl_fd = open(fname, O_RDWR | O_CLOEXEC)) == -1) {
usr.sbin/bgpd/mrt.c
1143
O_WRONLY|O_NONBLOCK|O_CREAT|O_TRUNC|O_CLOEXEC, 0644);
usr.sbin/bgpd/pftable.c
111
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
usr.sbin/bgpd/pftable.c
63
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
usr.sbin/bgpd/pftable.c
90
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
usr.sbin/cron/atrun.c
170
dfd = open(_PATH_AT_SPOOL, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
usr.sbin/cron/atrun.c
72
dfd = open(_PATH_AT_SPOOL, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
usr.sbin/cron/database.c
186
fd = openat(dfd, fname, O_RDONLY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC);
usr.sbin/hotplugd/hotplugd.c
89
if ((devfd = open(device, O_RDONLY | O_CLOEXEC)) == -1)
usr.sbin/rpki-client/main.c
383
if (pipe2(pi, O_CLOEXEC | O_NONBLOCK) == -1)
usr.sbin/rpki-client/output.c
179
fd = mkostemp(output_tmpname, O_CLOEXEC);
usr.sbin/rpki-client/repo.c
404
O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
usr.sbin/rpki-client/repo.c
796
if ((fd = mkostemp(temp, O_CLOEXEC)) == -1)
usr.sbin/vmd/config.c
263
kernfd = open(vm->vm_kernel_path, O_RDONLY | O_CLOEXEC);
usr.sbin/vmd/config.c
281
O_RDONLY | O_CLOEXEC)) == -1) {
usr.sbin/vmd/vm.c
1039
ret = pipe2(fds, O_CLOEXEC);
usr.sbin/vmd/vmd.c
687
env->vmd_fd = open(VMM_NODE, O_RDWR | O_CLOEXEC);
usr.sbin/vmd/vmm.c
76
dev_null = open("/dev/null", O_RDWR|O_CLOEXEC, 0);