O_CLOEXEC
cwdfd = open(".", O_RDONLY | O_CLOEXEC);
fd = open(path0, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0600);
if ((ttyfd = open(DEVTTY, O_RDWR | O_CLOEXEC)) >= 0) {
mem_fd = open(_PATH_MEM, O_RDWR|O_CLOEXEC);
mem_fd = open(PATH_APERTURE, O_RDWR|O_CLOEXEC);
fd = __pledge_open(_PATH_RESCONF, O_RDONLY|O_CLOEXEC);
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
if ((t->bt_fd = open(fname, flags | O_CLOEXEC, mode)) < 0)
if ((fd = mkostemp(path, O_CLOEXEC)) != -1)
if ((hashp->fp = open(file, flags | O_CLOEXEC, mode)) == -1)
if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1) {
if ((fd = open(file, O_RDONLY|O_CLOEXEC)) == -1)
if (fd == -1 && (newfd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC)) == -1)
(sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC)) == -1)
open(".", O_RDONLY | O_CLOEXEC)) == -1) {
open(".", O_RDONLY | O_CLOEXEC)) == -1) {
if ((fd = open(".", O_RDONLY | O_CLOEXEC)) == -1)
fd = __pledge_open(_PATH_GROUP, O_RDONLY|O_CLOEXEC);
fd = __pledge_open(_PATH_NETID, O_RDONLY|O_CLOEXEC);
fd = __pledge_open(_PATH_SMP_DB, O_RDONLY | O_CLOEXEC);
fd = __pledge_open(_PATH_MP_DB, O_RDONLY | O_CLOEXEC);
if ((res = open(_PATH_LOGIN_CONF, O_RDONLY|O_CLOEXEC)) >= 0)
fd = open(rundir, O_RDONLY|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC|O_CLOFORK);
fd = open(name, O_RDONLY | O_CLOEXEC);
if ((fd = open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) == -1)
if (pipe2(pdes, O_CLOEXEC) == -1) {
(input = output = __pledge_open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) {
fd = HIDDEN(openat)(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
(O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC | O_CLOFORK | O_NOFOLLOW)
flags |= O_CLOEXEC | O_NOFOLLOW;
p->dirfd = open(profdir, O_DIRECTORY|O_CLOEXEC, 0);
log = open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664);
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1)
int fd = __pledge_open(_PATH_PROTOCOLS, O_RDONLY|O_CLOEXEC);
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
if ((fd = open(path, O_RDONLY|O_CLOEXEC)) == -1)
if ((oflags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC))
o |= O_CLOEXEC;
if (dup3(f, wantfd, oflags & O_CLOEXEC) >= 0) {
if ((fd = open(name, flags | O_CLOEXEC)) == -1)
(O_APPEND | O_CLOEXEC | O_CLOFORK | O_DSYNC | O_RSYNC | O_SYNC)
return __pledge_open(name, O_RDONLY|O_CLOEXEC);
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#ifndef O_CLOEXEC
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#ifndef O_CLOEXEC
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#ifndef O_CLOEXEC
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#ifndef O_CLOEXEC
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#ifndef O_CLOEXEC
fd = open(file, O_WRONLY|O_CREAT|O_CLOEXEC, 0600);
if ((fd = open(path, O_RDWR|O_CLOEXEC)) == -1) {
if ((fc->fd = open("/dev/fuse0", O_RDWR|O_CLOEXEC)) == -1) {
flag |= O_CLOEXEC;
fd = open(uf, O_RDONLY | O_CLOEXEC);
fd = open(_PATH_KSYMS, O_RDONLY | O_CLOEXEC);
fd = open(uf, O_RDONLY | O_CLOEXEC);
fd = open(path, O_RDONLY|O_CLOEXEC);
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) < 0) {
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1) {
if ((fd = open(name, O_RDONLY|O_CLOEXEC)) == -1)
pfd = open(_PATH_MASTERPASSWD, O_RDONLY|O_CLOEXEC);
if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT|O_CLOEXEC, 0644))
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) >= 0) {
if ((fd = open(_PATH_UTMP, O_RDWR|O_CLOEXEC)) == -1)
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) == -1)
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
return (open(PATH_PTMDEV, O_RDWR|O_CLOEXEC));
fd = open(rpath, O_RDONLY|O_CLOEXEC);
fd = open(rpath, O_RDONLY|O_CLOEXEC);
if ((fd = open("/dev/diskmap", O_RDONLY|O_CLOEXEC)) != -1) {
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) == -1)
tmpfd = open(lcktmpname, O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664);
if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) == -1)
#ifdef O_CLOEXEC
oflag |= O_CLOEXEC;
#ifdef O_CLOEXEC
if (oflag & O_CLOEXEC)
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
if ((fd = _dl_open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) < 0)
libfile = _dl_open(libname, O_RDONLY | O_CLOEXEC);
libfile = _dl_open(libname, O_RDONLY | O_CLOEXEC);
if ((hfd = _dl_open(_PATH_LD_HINTS, O_RDONLY | O_CLOEXEC)) < 0) {
if (pipe2(pfd, O_CLOEXEC) == -1) {
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) == -1);
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) != -1);
ATF_REQUIRE_ERRNO(EINVAL, dup3(-1, -1, O_CLOEXEC) == -1);
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, -1, O_CLOEXEC) == -1);
ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
res.rlim_cur + 1, O_CLOEXEC) == -1);
fd = dup3(fd1, fd2, O_CLOEXEC);
err = pipe2(filedes, O_CLOEXEC);
run(O_CLOEXEC);
if (flags & O_CLOEXEC) {
kq = kqueue1(cloexec ? O_CLOEXEC : 0);
if (dup3(fdpre, 5, O_CLOEXEC) == -1)
if (dup3(fdpost, 6, O_CLOEXEC) == -1)
if (dup3(fdpre, 7, O_CLOEXEC) == -1)
if (dup3(fdpost, 7, O_CLOEXEC) == -1)
if (dup3(fdpost, 8, O_CLOEXEC) == -1)
if (dup3(fdpre, 8, O_CLOEXEC) == -1)
if (dup3(9, 9, O_CLOEXEC) != -1)
if (dup3(10, 10, O_CLOEXEC) != -1)
if ((bpffd = open("/dev/bpf", O_RDWR | O_CLOEXEC | O_NONBLOCK)) == -1)
fd = get_unused_fd_flags(O_CLOEXEC);
fence_state->fd = get_unused_fd_flags(O_CLOEXEC);
cloexec = (flags & O_CLOEXEC) ? UF_EXCLOSE : 0;
KASSERT((flags & O_CLOEXEC) != 0);
fd = get_unused_fd_flags(O_CLOEXEC);
int fd = get_unused_fd_flags(O_CLOEXEC);
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
exp_info.flags = O_CLOEXEC;
f_flags |= O_CLOEXEC;
#define DRM_CLOEXEC O_CLOEXEC
if (SCARG(uap, flags) & ~(O_CLOEXEC | O_CLOFORK))
if (flags & O_CLOEXEC)
cloexec = (flags & O_CLOEXEC) ? UF_EXCLOSE : 0;
if (SCARG(uap, flags) & ~(O_CLOEXEC | FNONBLOCK))
if (SCARG(uap, flags) & ~(O_CLOEXEC | O_CLOFORK | FNONBLOCK))
fdflags = ((flags & O_CLOEXEC) ? UF_EXCLOSE : 0)
fdflags = ((oflags & O_CLOEXEC) ? UF_EXCLOSE : 0)
(oflags & (O_CLOEXEC | O_CLOFORK));
fdflags = ((oflags & O_CLOEXEC) ? UF_EXCLOSE : 0)
fdflags = ((flags & O_CLOEXEC) ? UF_EXCLOSE : 0)
dfd = mkostemp(tempname, O_CLOEXEC);
pfd = open(_PATH_MASTERPASSWD, O_RDONLY|O_CLOEXEC);
if ((fd = mkostemp(tempname, O_CLOEXEC)) == -1 ||
image = open(tempname, O_RDWR | O_CLOEXEC);
pfd = open(_PATH_MASTERPASSWD, O_RDONLY | O_CLOEXEC);
#define MKOTEMP_FLAGS (O_APPEND | O_CLOEXEC | O_DSYNC | O_RSYNC | O_SYNC)
fd = open(dev, O_RDWR | O_CLOEXEC);
if ((ctl_fd = open(fname, O_RDWR | O_CLOEXEC)) == -1) {
O_WRONLY|O_NONBLOCK|O_CREAT|O_TRUNC|O_CLOEXEC, 0644);
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
if (devpf == -1 && ((devpf = open("/dev/pf", O_RDWR|O_CLOEXEC)) == -1))
dfd = open(_PATH_AT_SPOOL, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
dfd = open(_PATH_AT_SPOOL, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
fd = openat(dfd, fname, O_RDONLY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC);
if ((devfd = open(device, O_RDONLY | O_CLOEXEC)) == -1)
if (pipe2(pi, O_CLOEXEC | O_NONBLOCK) == -1)
fd = mkostemp(output_tmpname, O_CLOEXEC);
O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
if ((fd = mkostemp(temp, O_CLOEXEC)) == -1)
kernfd = open(vm->vm_kernel_path, O_RDONLY | O_CLOEXEC);
O_RDONLY | O_CLOEXEC)) == -1) {
ret = pipe2(fds, O_CLOEXEC);
env->vmd_fd = open(VMM_NODE, O_RDWR | O_CLOEXEC);
dev_null = open("/dev/null", O_RDWR|O_CLOEXEC, 0);