O_CLOEXEC
cwdfd = open(".", O_RDONLY | O_CLOEXEC);
int oflags = O_RDONLY | O_CLOEXEC;
if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC)) < 0) {
int oflags = O_RDONLY | O_CLOEXEC;
if (pipe2(pp, O_CLOEXEC) < 0)
fd = open(seedfile, O_RDONLY | O_BINARY | O_CLOEXEC);
ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
ret = fcc_open(context, id, &fd, O_RDWR | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
ret = fcc_open(context, id, &fd, O_WRONLY | O_APPEND | O_BINARY | O_CLOEXEC, 0);
ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
ret = fcc_open(context, from, &fd1, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
O_WRONLY | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
return fkt_start_seq_get_int(context, id, O_RDONLY | O_BINARY | O_CLOEXEC, 0, c);
fd = open (d->filename, O_RDWR | O_BINARY | O_CLOEXEC);
fd = open (d->filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
ret = fkt_start_seq_get_int(context, id, O_RDWR | O_BINARY | O_CLOEXEC, 1, &cursor);
c->fd = open (d->filename, O_RDONLY | O_BINARY | O_CLOEXEC, 0600);
fd = open (d->filename, O_RDWR | O_BINARY | O_CLOEXEC);
O_RDWR | O_BINARY | O_CREAT | O_EXCL | O_CLOEXEC, 0600);
#ifndef O_CLOEXEC
fd = open(data->filename, O_RDWR | O_BINARY | O_CLOEXEC);
fd = open(filename, flags | O_BINARY | O_CLOEXEC, 0600);
flags = O_CREAT | O_EXCL | O_RDWR | O_BINARY | O_CLOEXEC;
fd = open(data->filename, O_RDWR | O_BINARY | O_CLOEXEC, 0);
#ifndef O_CLOEXEC
fd = open(filename, O_RDWR | O_CLOEXEC, 0);
#ifndef O_CLOEXEC
# ifdef O_CLOEXEC
# define EFD_CLOEXEC O_CLOEXEC
# ifdef O_CLOEXEC
# define SFD_CLOEXEC O_CLOEXEC
OPENSSL_s390xcex = open("/dev/z90crypt", O_RDWR | O_CLOEXEC);
if ((t->bt_fd = _open(fname, flags | O_CLOEXEC, mode)) < 0)
if ((fd = mkostemp(path, O_CLOEXEC)) != -1)
#ifndef O_CLOEXEC
O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC | O_CLOEXEC)
if ((hashp->fp = _open(file, flags | O_CLOEXEC, mode)) == -1)
if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1)
if (fname != NULL && (rfd = _open(fname, flags | O_CLOEXEC, mode)) < 0)
if ((flags & ~(O_CLOEXEC | O_CLOFORK)) != 0) {
fdflags = ((flags & O_CLOEXEC) != 0 ? FD_CLOEXEC : 0) |
if (fd < 0 && (newfd = _open(path, O_RDONLY | O_CLOEXEC, 0)) < 0)
(sp->fts_rfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC,
_open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) {
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
O_CLOEXEC, 0)) < 0)
(sp->fts_rfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC,
_open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) {
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
O_CLOEXEC, 0)) < 0)
(sp->fts_rfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC,
_open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) {
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
fd = _open(*db_p, O_RDONLY | O_CLOEXEC, 0);
"..", O_RDONLY | O_CLOEXEC);
if ((openflags & ~(O_CLOEXEC | O_NONBLOCK)) != 0) {
if ((openflags & O_CLOEXEC) != 0)
oflags |= O_CLOEXEC;
fd = _open(name, O_RDONLY | O_CLOEXEC, 0);
if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1)
if ((fd = _open(name, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) == -1)
if (pipe2(pdes, O_CLOEXEC) < 0)
fd = _open(_PATH_UTX_LASTLOGIN, O_RDWR|O_CLOEXEC, 0644);
fd = _open(_PATH_UTX_LOG, O_CREAT|O_WRONLY|O_APPEND|O_CLOEXEC, 0644);
fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK|O_CLOEXEC, 0644);
input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC);
fd = _openat(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
fd = _open(path, flags | O_RDWR | O_CLOEXEC |
fd = _open(path, flags | O_RDWR | O_CLOEXEC | O_EXLOCK, mode);
(fd = _open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK|O_CLOEXEC, 0)) >=
if (pipe2(pdesw, O_CLOEXEC) < 0)
if (pipe2(pdes, O_CLOEXEC) < 0) {
fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0666);
log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664);
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1)
if ((fd = _open(buf, O_RDONLY | O_CLOEXEC)) < 0) {
if ((fd = _open(filename, O_RDONLY | O_CLOEXEC)) < 0)
if ((fd = _open(fname, O_RDONLY | O_CLOEXEC)) < 0) {
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) {
if ((oflags & O_CLOEXEC) != 0) {
o |= O_CLOEXEC;
if ((oflags & O_CLOEXEC) != 0) {
if ((oflags & O_CLOEXEC ? _fcntl(f, F_DUP2FD_CLOEXEC, wantfd) :
O_CLOEXEC | O_CLOFORK)) != 0) {
return (__sys_shm_open2(path, flags | O_CLOEXEC, mode, 0, NULL));
ATF_REQUIRE(pipe2(pipedes, O_CLOEXEC) == 0);
ATF_REQUIRE(pipe2(pipedes2, O_CLOEXEC) == 0);
ATF_TC_WITHOUT_HEAD(O_CLOEXEC);
ATF_TC_BODY(O_CLOEXEC, tc)
test_one(O_CLOEXEC);
test_one(O_APPEND|O_CLOEXEC);
ATF_TP_ADD_TC(tp, O_CLOEXEC);
(oflags & O_CLOEXEC ? FD_CLOEXEC : 0)) {
fd[i] = open(fn, O_CREAT|O_EXCL|O_EXLOCK|O_CLOEXEC, 0644);
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) {
if ((fa->fa_fdflags & O_CLOEXEC) != O_CLOEXEC) {
if ((kd->pmfd = open(mf, flag | O_CLOEXEC, 0)) < 0) {
kd->vmfd = open(_PATH_DEVNULL, O_RDONLY | O_CLOEXEC);
if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) <
if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) {
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) < 0)
if ((fd = open(map->pr_mapname, O_RDONLY | O_CLOEXEC)) < 0) {
(fd = _open(devname, O_RDONLY | O_CLOEXEC)) == -1) {
fd = _open(HYPERV_REFTSC_DEVPATH, O_RDONLY | O_CLOEXEC);
(fd = _open("/dev/" PVCLOCK_CDEVNAME, O_RDONLY | O_CLOEXEC)) < 0)
X(O_CLOEXEC) X(O_CLOFORK) X(O_NONBLOCK) XEND
lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if ((fd = open(file, O_RDONLY | O_CLOEXEC)) < 0)
else if ((r = open(login_dbarray[0], O_RDONLY | O_CLOEXEC)) >= 0)
dirfd = open(pfh->pf_dir, O_CLOEXEC | O_DIRECTORY | O_NONBLOCK);
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode);
O_RDONLY | O_CLOEXEC | O_NONBLOCK);
fd = openat(dirfd, filename, O_RDONLY | O_CLOEXEC);
lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if ((qf->fd = open(qf->qfname, qf->accmode|O_CLOEXEC)) < 0 &&
if ((qf->fd = open(qf->qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0)) <
if ((newqf->fd = open(qf->qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC,
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) < 0)
if ((tmpfd = open(lcktmpname, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC,
if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) < 0)
if ((fd = open(basedir, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) < 0)
fd = open(path, O_RDONLY | O_CLOEXEC);
if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) ==
if ((fd = open(path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) {
fd = __sys_openat(dirfd, n + 1, O_RDONLY | O_CLOEXEC | O_VERIFY);
fd = open(pathname, O_RDONLY | O_CLOEXEC | O_VERIFY);
fd = __sys_openat(dirfd, name, O_RDONLY | O_CLOEXEC | O_VERIFY);
fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY);
fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY);
ATF_REQUIRE_EQ(0, pipe2(pd, O_CLOEXEC));
fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC);
if (pipe2(filedes, O_CLOEXEC) != 0)
flags |= O_CLOEXEC;
flags |= O_CLOEXEC;
bsd_flags |= O_CLOEXEC;
flags |= O_CLOEXEC;
oflags |= O_CLOEXEC;
bsd_flags |= O_CLOEXEC;
#define DRM_CLOEXEC O_CLOEXEC
{ .f = O_CLOEXEC, .t = UF_EXCLOSE },
flags |= O_CLOEXEC;
O_CLOEXEC | O_CLOFORK);
error = falloc_caps(td, &fp, &fd, O_CLOEXEC, NULL);
_Static_assert(EFD_CLOEXEC == O_CLOEXEC, "Mismatched EFD_CLOEXEC");
fflags |= O_CLOEXEC;
if ((uap->flags & ~(O_CLOEXEC | O_CLOFORK | O_NONBLOCK)) != 0)
fflags = O_CLOEXEC;
fflags |= O_CLOEXEC;
if (uap->flags & ~(O_RDWR|O_NOCTTY|O_CLOEXEC))
error = falloc(td, &fp, &fd, O_CLOEXEC);
error = falloc(td, &fp, &fd, O_CLOEXEC);
if ((flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC |
error = falloc_caps(td, &fp, &fd, flags & O_CLOEXEC, fcaps);
return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC,
oflag |= O_CLOEXEC;
((flags & SOCK_CLOEXEC) != 0 ? O_CLOEXEC : 0) |
oflag |= O_CLOEXEC;
fdflags = ((flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0) |
*fflagsp |= O_CLOEXEC;
new_fd = get_unused_fd_flags(O_CLOEXEC);
#define TFD_CLOEXEC O_CLOEXEC
ATF_REQUIRE((rootfd = open("/", O_EXEC | O_CLOEXEC)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0);
if ((fd2 = dup3(fd1, fd1 + 1, O_CLOEXEC)) < 0)
if (dup3(fd1, fd1, O_CLOEXEC) != -1)
if ((fd2 = dup3(fd1, rlp.rlim_cur + 1, O_CLOEXEC)) >= 0)
m_fuse_fd = open("/dev/fuse", O_CLOEXEC | O_RDWR);
m_fuse_fd = open("/dev/fuse", O_CLOEXEC | O_RDWR | O_NONBLOCK);
fuse_fd = open("/dev/fuse", O_CLOEXEC | O_RDWR);
ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0);
ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0);
ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0);
ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0);
ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0);
fd = open("/dev/crypto", O_RDWR | O_CLOEXEC, 0);
if (pipe2(pfd, O_CLOEXEC) == -1)
if (pipe2(fd13, O_CLOEXEC))
if (pipe2(fd23, O_CLOEXEC))
if ((dotfd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
flags = O_RDONLY | O_CLOEXEC | O_PATH;
nameddir_fd = openat(file_fd, ".", O_RDONLY | O_CLOEXEC | O_NAMEDATTR,
if ((fm_fd = open("/dev/filemon", O_RDWR | O_CLOEXEC)) == -1)
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC,
rsfd = open(random_source, O_RDONLY | O_CLOEXEC);
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
if (pipe2(priv.wakeup, O_CLOEXEC | O_NONBLOCK) != 0)
return open(outfn, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, outfm);
tmpfd = mkostemp(tmpfil, O_CLOEXEC);
if (pipe2(signalpipe, O_CLOEXEC) != 0) {
O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC,
conf.rootfd = open(conf.rootdir, O_DIRECTORY|O_CLOEXEC);
skelfd = openat(conf.rootfd, skeldir, O_DIRECTORY|O_CLOEXEC);
s = open(_PATH_KLOG, O_RDONLY | O_NONBLOCK | O_CLOEXEC, 0);