FD_CLOEXEC
if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1) {
if (fcntl(new_sd, F_SETFD, FD_CLOEXEC) == -1) {
(void) fcntl(fileno(fp), F_SETFD, FD_CLOEXEC);
if ((flags != -1) && (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) != -1))
(void) fcntl(mp->sopipe[RDPIPE], F_SETFD, FD_CLOEXEC);
(void) fcntl(mp->sepipe[RDPIPE], F_SETFD, FD_CLOEXEC);
(void) fcntl(i, F_SETFD, FD_CLOEXEC);
FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(legacy_tmpl, F_SETFD, FD_CLOEXEC);
(void) fcntl(startd_tmpl, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(zfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(pm_fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(sensorp->fd, F_SETFD, FD_CLOEXEC);
if ((fdflags & FD_CLOEXEC) != 0) {
# ifndef FD_CLOEXEC
fcntl(sock, F_SETFD, fdflags | FD_CLOEXEC) == -1)
fcntl(kmem, F_SETFD, j | FD_CLOEXEC) < 0)
fcntl(kmem, F_SETFD, j | FD_CLOEXEC) < 0)
fcntl(kmem, F_SETFD, j | FD_CLOEXEC) < 0)
fcntl(kmem, F_SETFD, j | FD_CLOEXEC) < 0)
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(i, F_SETFD, j | FD_CLOEXEC);
fdflags | FD_CLOEXEC) == -1)
(void) fcntl(f, F_SETFD, FD_CLOEXEC);
(void) fcntl(pipefds[1], F_SETFD, FD_CLOEXEC);
fcntl(fileno(logfile), F_SETFD, FD_CLOEXEC) == -1)
fcntl(memfd, F_GETFD, 0) | FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
{ FD_CLOEXEC, "|FD_CLOEXEC" },
if (fcntl(ret, F_SETFD, FD_CLOEXEC) == 0) {
if (fcntl(fileno(fp), F_SETFD, FD_CLOEXEC) < 0) {
if ((flags != -1) && (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) != -1))
if (fcntl(newfd, F_SETFD, FD_CLOEXEC) == -1) {
dflags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
(void) fcntl(dp->doorfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(backd->doorfd, F_SETFD, FD_CLOEXEC);
fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
fcntl(tcdp->tcd_port, FD_CLOEXEC) == -1) {
if ((flags != -1) && (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) != -1))
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(dump_fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(dtfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC); /* close exec */
(void) fcntl(kcp->fd, F_SETFD, FD_CLOEXEC); /* close on exec */
(void) fcntl(destfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
if (fcntl(p->rsmseg_fd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(_rsm_fd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(p->rsmseg_fd, F_SETFD, FD_CLOEXEC) < 0) {
(void) fcntl(handle->rh_doorfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(doorfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(EV_FD(scp), F_SETFD, FD_CLOEXEC);
(void) fcntl(doorfd, F_SETFD, FD_CLOEXEC);
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
(void) fcntl(kernel_fd, F_SETFD, FD_CLOEXEC);
#ifdef FD_CLOEXEC
fcntl(http->fd, F_SETFD, FD_CLOEXEC); /* Close this socket when starting *
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
#define PRT_DUP3_GETFD (FD_CLOFORK | FD_CLOEXEC)
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
if ((oclo_rtdata[i].crt_flags & FD_CLOEXEC) != 0)
if ((c->clo_flags & FD_CLOEXEC) != 0)
oclo_setfd_common(c, FD_CLOEXEC);
oclo_setfd_common(c, FD_CLOFORK | FD_CLOEXEC);
oclo_fdup_common(c, FD_CLOEXEC, F_DUPFD_CLOEXEC);
oclo_fdup_common(c, FD_CLOEXEC, F_DUP2FD_CLOEXEC);
oclo_fdup_common(c, FD_CLOEXEC, F_DUP3FD);
oclo_fdup_common(c, FD_CLOEXEC | FD_CLOFORK, F_DUP3FD);
if ((targ_flags & FD_CLOEXEC) != 0)
oclo_dup_common(c, FD_CLOEXEC, true);
oclo_dup_common(c, FD_CLOEXEC | FD_CLOFORK, true);
if ((c->clo_flags & FD_CLOEXEC) != 0)
if ((c->clo_flags & FD_CLOEXEC) != 0)
if ((c->clo_flags & FD_CLOEXEC) != 0)
if ((targ_flags & FD_CLOEXEC) != 0)
oclo_accept_common(c, FD_CLOEXEC, true);
oclo_accept_common(c, FD_CLOEXEC | FD_CLOFORK, true);
if ((c->clo_flags & FD_CLOEXEC) != 0)
if ((targ_flags & FD_CLOEXEC) != 0)
oclo_rights_common(c, FD_CLOEXEC);
oclo_rights_common(c, FD_CLOEXEC | FD_CLOFORK);
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
.clo_flags = FD_CLOEXEC | FD_CLOFORK,
.clo_flags = FD_CLOEXEC,
(FD_CLOEXEC | FD_CLOFORK) + 1)) {
FD_CLOEXEC | FD_CLOFORK, &errstr, 0);
bool fail = (exp_flags & FD_CLOEXEC) != 0;
assert(flags != -1 && (flags & FD_CLOEXEC) == 0);
assert(flags != -1 && (flags & FD_CLOEXEC) == FD_CLOEXEC);
if ((res & FD_CLOEXEC) != 0) {
if ((res & FD_CLOEXEC) == 0) {
f_setfd_or(fd, FD_CLOEXEC);
f_setfd_or(fd, FD_CLOEXEC);
f_setfd_or(fd, FD_CLOEXEC);
if (orig_flags & (FD_CLOEXEC | FD_CLOFORK)) {
f_setfd_or(nfd, orig_flags & (FD_CLOEXEC | FD_CLOFORK));
f_setfd_or(nfd, FD_CLOEXEC);
flag |= FD_CLOEXEC;
flags &= (FD_CLOEXEC | FD_CLOFORK);
if ((ufp->uf_flag & FD_CLOEXEC) ||
if ((arg1 & ~(FD_CLOEXEC | FD_CLOFORK)) != 0) {
f_setfd_or(retval, FD_CLOEXEC);
f_setfd_or(iarg, FD_CLOEXEC);
f_setfd_or(fd, FD_CLOEXEC);
f_setfd_or(fd, FD_CLOEXEC);
f_setfd_or(fd1, FD_CLOEXEC);
f_setfd_or(fd2, FD_CLOEXEC);