fcntl
int flags = fcntl(0, F_GETFL, 0);
if (fcntl(0, F_SETFL, flags) >= 0) {
fd2 = fcntl(fd, F_DUPFD_CLOEXEC_MAYBE, 10);
fcntl(fd, F_SETFD, FD_CLOEXEC);
(ttyfd = fcntl(i, F_DUPFD_CLOEXEC_MAYBE, 10)) < 0) {
if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC_MAYBE, 10)) < 0) {
if (fcntl(ttyfd, F_SETFD, FD_CLOEXEC) < 0) {
if ((i = fcntl(fd, F_DUPFD_CLOEXEC_MAYBE, 10)) == -1) {
fcntl(i, F_SETFD, FD_CLOEXEC);
flags = fcntl(pip[1], F_GETFL, 0);
if (flags != -1 && fcntl(pip[1], F_SETFL, flags | O_NONBLOCK) != -1) {
fcntl(pip[1], F_SETFL, flags);
if ((flags = fcntl(fileno(tracefile), F_GETFL, 0)) >= 0)
fcntl(fileno(tracefile), F_SETFL, flags | O_APPEND);
int flags = fcntl(s, F_GETFD);
return (fcntl(s, F_SETFL, flags | O_NONBLOCK) != -1);
return (fcntl(s, F_SETFL, flags & ~O_NONBLOCK) != -1);
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);
(val = fcntl(rfd, F_GETFL)) != -1 && !(val & O_NONBLOCK)) {
(val = fcntl(wfd, F_GETFL)) != -1 && !(val & O_NONBLOCK)) {
(val = fcntl(efd, F_GETFL)) != -1 && !(val & O_NONBLOCK)) {
(void)fcntl(*fdp, F_SETFL, c->restore_flags[0]);
(void)fcntl(*fdp, F_SETFL, c->restore_flags[1]);
(void)fcntl(*fdp, F_SETFL, c->restore_flags[2]);
val = fcntl(fd, F_GETFL);
if (fcntl(fd, F_SETFL, val) == -1) {
val = fcntl(fd, F_GETFL);
if (fcntl(fd, F_SETFL, val) == -1) {
if (fcntl(dupfd, F_GETFL) == -1 && errno == EBADF) {
if (fcntl(x, F_SETFD, FD_CLOEXEC) == -1) \
(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);
if (fcntl(listen_sock, F_SETFD, FD_CLOEXEC) == -1) {
flags = fcntl(score_fd, F_GETFD);
if (fcntl(score_fd, F_SETFD, flags) == -1)
flags = fcntl(newsock, F_GETFL, 0);
fcntl(newsock, F_SETFL, flags);
flags = fcntl(s, F_GETFL, 0);
fcntl(s, F_SETFL, flags);
lflags = fcntl(line, F_GETFL);
fcntl(line, F_SETFL, &lflags);
flags = fcntl(sock, F_GETFL, 0);
fcntl(sock, F_SETFL, flags & ~O_NONBLOCK);
flags = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
fcntl(iocom->wakeupfds[0], F_SETFL, O_NONBLOCK);
fcntl(iocom->wakeupfds[1], F_SETFL, O_NONBLOCK);
fcntl(sock_fd, F_SETFL, O_NONBLOCK);
fcntl(alt_fd, F_SETFL, O_NONBLOCK);
flags = fcntl(sd, F_GETFD);
(void)fcntl(sd, F_SETFD, flags | FD_CLOEXEC);
if (fcntl(kd->pmfd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(kd->vmfd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(kd->nlfd, F_SETFD, FD_CLOEXEC) < 0) {
__strong_reference(__fcntl, fcntl);
flags = fcntl(f, F_GETFL, NULL);
fcntl(f, F_SETFL, flags);
if ((fflags = fcntl(fd_in, F_GETFD)) <0)
fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
if ((flags = fcntl(pdata, F_GETFL, 0)) == -1 ||
fcntl(pdata, F_SETFL, flags | O_NONBLOCK) == -1)
if ((flags = fcntl(pdata, F_GETFL, 0)) == -1 ||
fcntl(pdata, F_SETFL, flags & ~O_NONBLOCK) == -1)
if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1)
fd = fcntl(fd_u, F_DUPFD_CLOEXEC, 0);
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
fcntl(0, F_SETFL, O_NONBLOCK);
if (fcntl(STDERR_FILENO, F_GETFL) < 0) {
if (fcntl(rt_sock, F_SETFL, O_NONBLOCK) == -1)
if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
if ((oflags = fcntl(fd, F_GETFL)) == -1) {
if (fcntl(fd, F_SETFL, oflags & ~O_NONBLOCK) == -1) {
flags = fcntl(s, F_GETFL, 0);
ret = fcntl(s, F_SETFL, flags | O_NONBLOCK);
flags = fcntl(s, F_GETFL, 0);
ret = fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
fcntl(net_fd, F_SETFL, O_NONBLOCK);
if (fcntl(KQueueFd, F_SETOWN, getpid()) < 0)
if (fcntl(KQueueFd, F_SETFL, O_ASYNC) < 0)
int fcntl(int, int, ...);
struct fcntl_args fcntl;
if (fcntl(fd2, F_GETFD) != 0)
if (fcntl(fd2, F_GETFD) == 0)
if ((fd2 = fcntl(fd1, F_DUPFD, 10)) < 0)
if (fcntl(fd2, F_GETFD) != 0)
if ((fd2 = fcntl(fd1, F_DUP2FD, fd1 + 1)) < 0)
if (fcntl(fd2, F_GETFD) != 0)
if ((fd2 = fcntl(fd1, F_DUP2FD, fd1)) < 0)
if (fcntl(fd2, F_GETFD) == 0)
if ((fd2 = fcntl(fd1, F_DUP2FD, rlp.rlim_cur + 1)) >= 0)
if ((fd2 = fcntl(fd1, F_DUPFD_CLOEXEC, 10)) < 0)
if (fcntl(fd2, F_GETFD) != 1)
if ((fd2 = fcntl(fd1, F_DUP2FD_CLOEXEC, fd1 + 1)) < 0)
if (fcntl(fd2, F_GETFD) != FD_CLOEXEC)
if ((fd2 = fcntl(fd1, F_DUP2FD_CLOEXEC, rlp.rlim_cur + 1)) >= 0)
if (fcntl(fd2, F_GETFD) != FD_CLOEXEC)
if (fcntl(fd2, F_GETFD) != 0)
if ((fd2 = fcntl(fd1, F_DUPFD_CLOFORK, 10)) < 0)
if (fcntl(fd2, F_GETFD) != FD_CLOFORK)
if (fcntl(fd2, F_GETFD) != FD_CLOFORK)
if (fcntl(fd2, F_GETFD) != 0)
if (fcntl(fd1, F_SETFD, 1) != 0)
fcntl(fds[0], F_SETFL, 0);
fcntl(fds[1], F_SETFL, 0);
if (fcntl(fd, F_SETLKW, &lk) == 0) {
if (fcntl(fd, F_SETLKW, &lk) == 0) {
while ((r = fcntl(fd, F_GETLK, &lk)) == 0) {
if (fcntl(fd, F_SETLKW, &lk) == 0) {
int flags = fcntl(rt->crt_fd, F_GETFD, NULL);
if (fcntl(fd, F_SETFD, targ_flags) < 0) {
dup = fcntl(fd, cmd, fd);
dup = fcntl(fd, cmd, fd + 1);
dup = fcntl(fd, cmd | (targ_flags << F_DUP3FD_SHIFT), fd + 1);
int fd = fcntl(STDERR_FILENO, F_DUP3FD | (flags << F_DUP3FD_SHIFT), 23);
max = fcntl(0, F_MAXFD);
int flags = fcntl(fd, F_GETFD, NULL);
ret = fcntl(fd, F_SETLKW, &fl);
flags = fcntl(fd, F_GETFL, 0);
if (fcntl(fd, F_SETFL, flags|O_DIRECT) < 0) {
fcntl(lockdes, F_SETLKW, &lock);
fcntl(lockdes, F_SETLKW, &lock);
if ((status = fcntl(0, F_GETFL, 0)) == -1)
if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1)
if ((status = fcntl(0, F_GETFL, 0)) == -1)
if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1)
if ((flags = fcntl(0, F_GETFL, 0)) == -1)
if (fcntl(0, F_SETFL, flags | O_NONBLOCK) == -1)
fcntl(3, F_SETFD, 0);
fcntl(MasterPtyFd, F_SETFL, O_NONBLOCK);
fcntl(fileno(otf), F_SETFD, 1);
fcntl(fileno(itf), F_SETFD, 1);
fcntl(image, F_SETFD, 1);
fcntl(p[READ], F_SETFD, 1);
fcntl(p[WRITE], F_SETFD, 1);
fcntl(fileno(fp), F_SETFD, 1);
fcntl(fileno(fp), F_SETFD, 1);
fcntl(fd, F_SETFD, FD_CLOEXEC);
fcntl(tap_fd, F_SETFL, 0);
(void) fcntl(fd, F_SETFL, 0); /* clear O_NONBLOCK */
(void) fcntl(fileno(cc_trace_fp), F_SETFD, 1);
(void) fcntl(fileno(cx.x_fp), F_SETFD, 1);
(void) fcntl(d[0], F_SETFD, 1);
(void) fcntl(d[1], F_SETFD, 1);
(void) fcntl(w->ww_pty, F_SETFD, 1);
fcntl(fd, F_SETFD, 1);
fcntl(LogFD, F_SETFD, 1);
flags = fcntl(ns, F_GETFL, 0);
fcntl(ns, F_SETFL, flags);
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
if ((fc = fcntl(s->server_fd, F_GETFL)) == -1 ||
fcntl(s->server_fd, F_SETFL, fc | O_NONBLOCK) == -1) {
if (fcntl(sep->se_fd, F_SETFD, FD_CLOEXEC) < 0) {
if (fcntl(ctrl, F_SETFD, 0) < 0) {
fcntl(lfd, F_SETFL, 0); /* turn off non-blocking mode */
if (fcntl(lfd, F_SETFL, 0) < 0) {
fcntl(retval->sockfd, F_SETFL, O_NONBLOCK);
fcntl(client_socket, F_SETFL, O_NONBLOCK);
fcntl(fd, F_SETFD, 1);
fcntl(i, F_SETFD, 1);
fcntl(i, F_SETFD, 1);
stat = fcntl(fids[0], F_GETFL, 0);
fcntl(fids[0], F_SETFL, stat);
fcntl(i, F_SETFD, 1);
stat = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, stat);
stat = fcntl(p->fd_in, F_GETFL, 0);
fcntl(p->fd_in, F_SETFL, stat);
stat = fcntl(p->fd_in, F_GETFL, 0);
fcntl(p->fd_in, F_SETFL, stat);
stat = fcntl(p->fd_in, F_GETFL, 0);
fcntl(p->fd_in, F_SETFL, stat);
oldflag = fcntl(p->fd, F_GETFL, 0);
fcntl(p->fd, F_SETFL, oldflag | O_NONBLOCK);
if ((oldflag = fcntl(p->fd, F_GETFL, 0)) != -1)
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
oldflag = fcntl(p->fd, F_GETFL, 0);
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
if ((flags = fcntl(fd, F_GETFL, 0)) == -1) {
if ((flags = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1) {
if ((flags = fcntl(s->si_fd, F_GETFL, 0)) == -1) {
if ((flags = fcntl(s->si_fd, F_SETFL, flags | O_NONBLOCK)) == -1) {
if (fcntl(pfd[1], F_SETFL, O_NONBLOCK) == -1) {
if (fcntl(fklog, F_SETFL, O_NONBLOCK) < 0)
fcntl(tap_fd, F_SETFL, 0);
if (fcntl(resfd, F_SETFL, O_NONBLOCK) == -1) {