F_SETFD
if (fcntl(fd, F_SETFD, ret | FD_CLOEXEC) == -1)
#ifdef F_SETFD
# define set_cloexec_fd(FD) ((void)fcntl((FD), F_SETFD, FD_CLOEXEC))
# define set_cloexec_fd(FD) ((void)fcntl((FD), F_SETFD, 1))
if (fcntl(t->bt_fd, F_SETFD, 1) == -1)
(void)fcntl(hashp->fp, F_SETFD, 1);
if (fname != NULL && fcntl(rfd, F_SETFD, 1) == -1) {
fcntl (fd, F_SETFD, FD_CLOEXEC);
if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1 ||
(void)fcntl(rfd, F_SETFD, FD_CLOEXEC);
(void)fcntl(wfd, F_SETFD, FD_CLOEXEC);
(void)fcntl(efd, F_SETFD, FD_CLOEXEC);
if (fcntl(x, F_SETFD, FD_CLOEXEC) == -1) \
(void)fcntl(s, F_SETFD, FD_CLOEXEC);
(void)fcntl(sock, F_SETFD, FD_CLOEXEC);
if (fcntl(sock, F_SETFD, 0) == -1) /* keep the socket on exec */
fcntl(sock_out, F_SETFD, FD_CLOEXEC);
fcntl(sock_in, F_SETFD, FD_CLOEXEC);
fcntl(sock_out, F_SETFD, FD_CLOEXEC);
fcntl(sock_in, F_SETFD, FD_CLOEXEC);
if (fcntl(listen_sock, F_SETFD, FD_CLOEXEC) == -1) {
return fcntl(fd, F_SETFD, FD_CLOEXEC) >= 0;
rc = _fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
(void)_fcntl(pdes[1], F_SETFD, 0);
(void)_fcntl(pdes[1], F_SETFD, 0);
(void)_fcntl(pdes[0], F_SETFD, 0);
(void)_fcntl(fileno(iop), F_SETFD, 0);
if (_fcntl(fae->fae_fildes, F_SETFD, 0) == -1)
if (_fcntl(fae->fae_newfildes, F_SETFD, 0) == -1)
_fcntl(pdes[1], F_SETFD, 0)) < 0)
if (_fcntl(pdesw[0], F_SETFD, 0) < 0)
_fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
_fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
rc = _fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
(void) _fcntl(fp->_file, F_SETFD,
if (_fcntl(ysd->dom_socket, F_SETFD, 1) == -1)
if (fcntl(fd, F_SETFD, fa->fa_fdflags) == -1) {
(void)fcntl(sd, F_SETFD, flags | FD_CLOEXEC);
(void) fcntl(fds[i], F_SETFD, FD_CLOEXEC);
case F_SETFD:
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
case F_SETFD:
return (kern_fcntl(td, args->fd, F_SETFD, args->arg));
(void)kern_fcntl(td, fd, F_SETFD, FD_CLOEXEC);
case F_SETFD:
{ BSM_F_SETFD, F_SETFD },
EXPECT_OK(fcntl(caps[0], F_SETFD, 0));
if (fcntl(fd1, F_SETFD, 1) != 0)
ATF_REQUIRE_MSG(fcntl(pathfd, F_SETFD, FD_CLOEXEC) == 0,
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
CHECK(fcntl(fd, F_SETFD, 0) == 0);
(void)fcntl(fileno(otf), F_SETFD, 1);
(void)fcntl(fileno(itf), F_SETFD, 1);
(void)fcntl(image, F_SETFD, 1);
(void)fcntl(p[READ], F_SETFD, 1);
(void)fcntl(p[WRITE], F_SETFD, 1);
(void)fcntl(fileno(fp), F_SETFD, 1);
(void)fcntl(fileno(fp), F_SETFD, 1);
pipe(spd) != 0 || fcntl(spd[1], F_SETFD, FD_CLOEXEC) != 0)
if (fcntl(apmnorm_fd, F_SETFD, 1) == -1) {
if (fcntl(apmctl_fd, F_SETFD, 1) == -1) {
(void) fcntl(LogFD, F_SETFD, 1);
if (fcntl(ctrl, F_SETFD, 0) < 0) {
fcntl(fd, F_SETFD, 1);
fcntl(i, F_SETFD, 1);
fcntl(i, F_SETFD, 1);
fcntl(i, F_SETFD, 1);