FD_CLOEXEC
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
#if defined(FIOCLEX) || defined(FD_CLOEXEC)
if (c & FD_CLOEXEC)
cloexec = FD_CLOEXEC;
cloexec &= FD_CLOEXEC;
(void)fcntl(i, F_SETFD, (fcntl_int) FD_CLOEXEC);
(void)fcntl(f, F_SETFD, (fcntl_int) FD_CLOEXEC);
(fcntl_int)(fcntl(newfd, F_GETFD) | FD_CLOEXEC));
(void)fcntl(fd, F_SETFD, (fcntl_int) FD_CLOEXEC);
#ifndef FD_CLOEXEC
(fcntl_int)(fcntl((fd), F_GETFD) | FD_CLOEXEC)))
fcntl(fd, F_SETFD, FD_CLOEXEC);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1 ||
flags |= FD_CLOEXEC;
flags |= FD_CLOEXEC;
fdflags = FD_CLOEXEC|FD_CLOFORK;
fdflags = FD_CLOEXEC;
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
fcntl(statp->_vcsock, F_SETFD, FD_CLOEXEC);
fcntl(EXT(statp)nssocks[ns], F_SETFD, FD_CLOEXEC);
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
if (fcntl(ysd->dom_socket, F_SETFD, FD_CLOEXEC) == -1)
fcntl(fd, F_SETFD, opts | FD_CLOEXEC) == -1) {
(void)fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
kp->ki_ofileflags = (ff->ff_exclose ? FD_CLOEXEC : 0) |
*retval = (dt->dt_ff[fd]->ff_exclose ? FD_CLOEXEC : 0) |
fd_set_exclose(l, fd, (tmp & FD_CLOEXEC) != 0);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
RL(fcntl(fd, F_SETFD, FD_CLOEXEC));
ATF_REQUIRE_MSG((fcntl(fd, F_GETFD) & FD_CLOEXEC) == 0,
ATF_REQUIRE_MSG((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0,
ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE(fcntl(efd, F_SETFD, FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) != 0);
ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) == 0);
ATF_REQUIRE(fcntl(tfd, F_SETFD, FD_CLOEXEC) == 0);
ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) != 0);
ATF_CHECK_EQ(FD_CLOEXEC|FD_CLOFORK, fcntl(fdm, F_GETFD));
if (rump_sys_fcntl(s1, F_SETFD, FD_CLOEXEC) == -1) {
if (rump_sys_fcntl(p1[0], F_SETFD, FD_CLOEXEC) == -1)
if (rump_sys_fcntl(p1[1], F_SETFD, FD_CLOEXEC) == -1)
fcntl(sd, F_SETFD, FD_CLOEXEC);
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
(void)fcntl(tokenPoolReader, F_SETFD, FD_CLOEXEC);
(void)fcntl(tokenPoolWriter, F_SETFD, FD_CLOEXEC);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
#ifndef FD_CLOEXEC
(void)fcntl(dupfd, F_SETFD, FD_CLOEXEC);
(void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC);
(void)fcntl(childPipe[0], F_SETFD, FD_CLOEXEC);
(void)fcntl(childPipe[1], F_SETFD, FD_CLOEXEC);
if (fcntl(sep->se_fd, F_SETFD, FD_CLOEXEC) < 0) {
if (prog_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {