Symbol: O_CLOEXEC
bin/dd/args.c
447
{ "cloexec", O_CLOEXEC, C_IFLAG|C_OFLAG },
bin/rcp/rcp.c
834
ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
bin/sh/histedit.c
473
n = open_history_file(name, O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC);
bin/sh/redir.c
1002
f |= O_CLOEXEC;
bin/sh/redir.c
1078
if ((pos & O_CLOEXEC) && !(f & O_CLOEXEC))
bin/sh/redir.c
1080
if ((neg & O_CLOEXEC) && (f & O_CLOEXEC))
bin/sh/redir.c
1088
pos &= ~O_CLOEXEC;
bin/sh/redir.c
1089
neg &= ~O_CLOEXEC;
bin/sh/redir.c
1090
f &= ~O_CLOEXEC;
bin/sh/redir.c
642
#ifdef O_CLOEXEC
bin/sh/redir.c
643
newfd = dup3(from, to, O_CLOEXEC);
bin/sh/redir.c
922
#ifndef O_CLOEXEC
bin/sh/redir.c
927
{ "cloexec", 2, O_CLOEXEC },
common/dist/zlib/gzlib.c
134
#ifdef O_CLOEXEC
common/dist/zlib/gzlib.c
136
oflag |= O_CLOEXEC;
common/dist/zlib/gzlib.c
258
#ifdef O_CLOEXEC
common/dist/zlib/gzlib.c
259
if (oflag & O_CLOEXEC)
common/dist/zlib/gzlib.c
260
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
lib/libc/citrus/citrus_mmap.c
64
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/compat/sys/compat_dup3.c
62
switch (flags & (O_CLOEXEC|O_CLOFORK)) {
lib/libc/compat/sys/compat_dup3.c
63
case O_CLOEXEC|O_CLOFORK:
lib/libc/compat/sys/compat_dup3.c
66
case O_CLOEXEC:
lib/libc/db/db/db.c
54
#ifndef O_CLOEXEC
lib/libc/db/db/db.c
66
O_RDWR | O_SHLOCK | O_TRUNC | O_CLOEXEC)
lib/libc/db/db/dbfile.c
54
#ifndef O_CLOEXEC
lib/libc/db/db/dbfile.c
58
if ((fd = open(file, flags | O_CLOEXEC, mode)) == -1)
lib/libc/db/db/dbfile.c
61
#if O_CLOEXEC == 0
lib/libc/gen/fts.c
1222
if (oldfd < 0 && (fd = open(path, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
213
#ifndef O_CLOEXEC
lib/libc/gen/fts.c
217
if ((sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
lib/libc/gen/fts.c
370
if ((p->fts_symfd = open(".", O_RDONLY | O_CLOEXEC, 0))
lib/libc/gen/fts.c
472
open(".", O_RDONLY | O_CLOEXEC, 0)) == -1) {
lib/libc/gen/fts.c
614
if ((fd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
lib/libc/gen/getcap.c
325
if ((capdbp = dbopen(pbuf, O_RDONLY | O_CLOEXEC, 0,
lib/libc/gen/getcap.c
355
fd = open(*db_p, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/getpass.c
111
O_RDWR | O_CLOEXEC)) == -1) {
lib/libc/gen/initdir.c
156
if ((fd = open(name, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/gen/nlist.c
122
fd = open(name, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/opendir.c
81
if ((fd = open(name, O_RDONLY|O_DIRECTORY|O_NONBLOCK|O_CLOEXEC)) == -1)
lib/libc/gen/popen.c
96
int flags = strchr(*type, 'e') ? O_CLOEXEC : 0;
lib/libc/gen/utmpx.c
346
fd = open(file, O_WRONLY|O_APPEND|O_SHLOCK|O_CLOEXEC);
lib/libc/gen/utmpx.c
349
if ((fd = open(file, O_CREAT|O_WRONLY|O_EXLOCK|O_CLOEXEC, 0644)) == -1)
lib/libc/gen/utmpx.c
435
db = dbopen(fname, O_RDONLY|O_SHLOCK|O_CLOEXEC, 0, DB_HASH, NULL);
lib/libc/gen/utmpx.c
474
db = dbopen(fname, O_RDWR|O_CREAT|O_EXLOCK|O_CLOEXEC, 0644, DB_HASH, NULL);
lib/libc/gen/xsyslog.c
355
O_WRONLY | O_NONBLOCK | O_CLOEXEC, 0)) >= 0) {
lib/libc/gmon/gmon.c
445
#define OPEN_FLAGS (O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC)
lib/libc/hash/hashhl.c
99
if ((fd = open(filename, O_RDONLY | O_CLOEXEC)) < 0)
lib/libc/md/mdXhl.c
82
f = open(filename, O_RDONLY | O_CLOEXEC, 0666);
lib/libc/nls/catopen.c
167
if ((fd = open(path, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/resolv/res_init.c
199
ext->kq = kqueue1(O_CLOEXEC);
lib/libc/resolv/res_send.c
368
if ((kq = kqueue1(O_CLOEXEC)) == -1) {
lib/libc/stdio/flags.c
105
o |= O_CLOEXEC;
lib/libc/stdio/gettemp.c
92
O_CLOEXEC | O_CLOFORK)) != 0) {
lib/libc/stdlib/malloc.c
119
{ if ((fdzero = open(_PATH_DEVZERO, O_RDWR | O_CLOEXEC, 0000)) == -1) \
lib/libc/sys/adjtime.c
79
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY | O_CLOEXEC, 0);
lib/libc/sys/clock_settime.c
81
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY | O_CLOEXEC, 0);
lib/libc/sys/ntp_adjtime.c
89
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY | O_CLOEXEC, 0);
lib/libc/sys/settimeofday.c
80
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY | O_CLOEXEC, 0);
lib/libc/time/localtime.c
1032
int oflags = (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK
lib/libc/time/localtime.c
1089
| O_BINARY | O_CLOEXEC | O_CLOFORK | O_DIRECTORY));
lib/libc/time/localtime.c
348
#ifndef O_CLOEXEC
lib/libc/yp/yplib.c
118
if ((fd = open(YPBINDLOCK, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/yp/yplib.c
158
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libkvm/kvm.c
342
kd->nlfd = open(_PATH_KSYMS, O_RDONLY | O_CLOEXEC, 0);
lib/libkvm/kvm.c
344
if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) {
lib/libkvm/kvm.c
353
if ((kd->pmfd = open(mf, flag | O_CLOEXEC, 0)) < 0) {
lib/libkvm/kvm.c
367
if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC, 0)) < 0) {
lib/libkvm/kvm.c
372
if ((kd->swfd = open(sf, flag | O_CLOEXEC, 0)) < 0) {
lib/libnvmm/libnvmm.c
163
nvmm_fd = open("/dev/nvmm", O_RDONLY | O_CLOEXEC);
lib/libnvmm/libnvmm.c
186
nvmm_fd = open("/dev/nvmm", O_WRONLY | O_CLOEXEC);
lib/librt/shm.c
129
return open(path, oflag | O_CLOEXEC | O_NOFOLLOW, mode);
lib/libutil/pidfile.c
257
#ifdef O_CLOEXEC
lib/libutil/pidfile.c
258
opts |= O_CLOEXEC;
lib/libutil/pidfile.c
266
#ifndef O_CLOEXEC
sbin/gpt/gpt_uuid.c
292
fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
sbin/scan_ffs/scan_ffs.c
416
ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
sys/compat/linux/arch/alpha/linux_pipe.c
86
if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0)
sys/compat/linux/common/linux_file.c
118
res |= cvtto_bsd_mask(lflags, LINUX_O_CLOEXEC, O_CLOEXEC);
sys/compat/linux/common/linux_file.c
144
res |= cvtto_linux_mask(bflags, O_CLOEXEC, LINUX_O_CLOEXEC);
sys/compat/linux/common/linux_file.c
906
if ((flags & ~O_CLOEXEC) != 0)
sys/compat/linux/common/linux_pipe.c
91
if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0)
sys/compat/linux32/common/linux32_unistd.c
334
if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0)
sys/dev/nvmm/nvmm.c
1140
if (!(flags & O_CLOEXEC))
sys/kern/kern_descrip.c
1967
fd_set_exclose(curlwp, fd, (flag & O_CLOEXEC) != 0);
sys/kern/kern_descrip.c
779
if (flags & ~(O_CLOEXEC|O_CLOFORK|O_NONBLOCK|O_NOSIGPIPE))
sys/kern/kern_descrip.c
820
fd_set_exclose(curlwp, newfd, (flags & O_CLOEXEC) != 0);
sys/kern/kern_event.c
1742
fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
sys/kern/sys_epoll.c
108
SCARG(&kqa, flags) |= O_CLOEXEC;
sys/kern/sys_pipe.c
215
if (flags & ~(O_CLOEXEC|O_CLOFORK|O_NONBLOCK|O_NOSIGPIPE))
sys/kern/sys_pipe.c
242
fd_set_exclose(l, fildes[0], (flags & O_CLOEXEC) != 0);
sys/kern/sys_pipe.c
249
fd_set_exclose(l, fildes[1], (flags & O_CLOEXEC) != 0);
sys/kern/tty_ptm.c
210
fd_set_exclose(l, *fd, (flags & O_CLOEXEC) != 0);
sys/kern/uipc_socket.c
1410
O_CLOEXEC : 0) |
sys/kern/uipc_syscalls.c
1278
if (flags & ~(O_CLOEXEC|O_CLOFORK|O_NONBLOCK|O_NOSIGPIPE))
sys/kern/uipc_syscalls.c
1280
if (flags & O_CLOEXEC)
sys/kern/uipc_usrreq.c
1485
fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
sys/kern/vfs_syscalls.c
332
if (flags & O_CLOEXEC)
sys/sys/epoll.h
41
#define EPOLL_CLOEXEC O_CLOEXEC
sys/sys/eventfd.h
45
#define EFD_CLOEXEC O_CLOEXEC
sys/sys/fcntl.h
143
O_DIRECTORY|O_CLOEXEC|O_CLOFORK|O_NOSIGPIPE|\
sys/sys/timerfd.h
46
#define TFD_CLOEXEC O_CLOEXEC
tests/kernel/t_cloexec.c
108
RL(fd3 = dup3(STDIN_FILENO, 3, O_CLOEXEC));
tests/kernel/t_cloexec.c
130
RL(fd = kqueue1(O_CLOEXEC));
tests/kernel/t_cloexec.c
140
RL(fd = open("file", O_RDWR|O_CREAT|O_CLOEXEC, 0644));
tests/kernel/t_cloexec.c
172
RL(pipe2(fd, O_CLOEXEC));
tests/kernel/t_cloexec.c
182
RL(pipe2(fd, O_CLOEXEC));
tests/kernel/t_cloexec.c
98
RL(fd = open("/dev/drvctl", O_RDONLY|O_CLOEXEC));
tests/lib/libc/gen/posix_spawn/t_fileactions.c
290
RL(fd2 = open("/dev/null", O_WRONLY, O_CLOEXEC));
tests/lib/libc/gen/posix_spawn/t_spawn.c
538
RL(pipe2(fd, O_CLOEXEC));
tests/lib/libc/stdlib/t_mktemp.c
197
O_SYNC, O_CLOEXEC
tests/lib/libc/stdlib/t_mktemp.c
232
O_SYNC, O_CLOEXEC
tests/lib/libc/sys/t_dup.c
211
ATF_REQUIRE_ERRNO(EINVAL, dup3(fd, fd, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
214
ATF_REQUIRE_ERRNO(EINVAL, dup3(-1, -1, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
217
ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
220
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
243
res.rlim_cur + 1, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
80
fd = dup3(fd1, fd2, O_CLOEXEC);
tests/lib/libc/sys/t_pipe2.c
146
err = pipe2(filedes, O_CLOEXEC);
tests/lib/libc/sys/t_pipe2.c
171
run(O_CLOEXEC);
tests/lib/libc/sys/t_pipe2.c
71
if (flags & O_CLOEXEC) {
tests/lib/libc/ttyio/t_ptm.c
180
if ((fdm = posix_openpt(O_RDWR|O_NONBLOCK|O_CLOEXEC|O_CLOFORK)) == -1) {
tests/lib/libpthread/t_cancellation.c
166
RL(accept4(sock, NULL, NULL, O_CLOEXEC));
tools/compat/compat_defs.h
728
#ifndef O_CLOEXEC
usr.bin/find/main.c
151
if ((dotfd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
usr.bin/find/misc.c
154
ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
usr.bin/gzip/gzip.c
1774
ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
usr.bin/ktrace/ktrace.c
331
if (pipe2(pi, O_CLOEXEC) == -1)
usr.bin/mail/dotlock.c
85
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC|O_CLOEXEC, 0);
usr.bin/mail/mime_child.c
98
if (pipe2(p, O_CLOEXEC) == -1)
usr.bin/mail/mime_detach.c
128
if ((fd = open(fname, flags | O_CLOEXEC, 0600)) != -1 &&
usr.bin/mail/names.c
299
image = open(tempname, O_RDWR | O_CLOEXEC);
usr.bin/mail/popen.c
246
if (pipe2(p, O_CLOEXEC) < 0)
usr.bin/make/filemon/filemon_dev.c
77
for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR|O_CLOEXEC)) == -1; i++) {
usr.bin/make/filemon/filemon_ktrace.c
208
if (pipe2(ktrpipe, O_CLOEXEC|O_NONBLOCK) == -1) {
usr.bin/usbhidaction/usbhidaction.c
152
fd = open(dev, O_RDWR | O_CLOEXEC);
usr.sbin/autofs/automountd.c
519
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
usr.sbin/autofs/automountd.c
523
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
usr.sbin/nfsd/nfsd.c
310
r = pipe2(detach_msg_pipe, O_CLOEXEC|O_NOSIGPIPE);