Lines Matching defs:cloexec
87 #define CLOEXEC(fd) (fcntl((fd), F_SETFD, \
90 #define CLOEXEC(fd) __nothing
104 int cloexec; /* orig had FD_CLOEXEC set (into always does) */
203 rl->cloexec ? " (colexec)" : ""));
204 copyfd(rl->into, rl->orig, rl->cloexec, 1);
229 fd_rename(struct redirtab *rt, int from, int to, int cloexec)
244 rl->cloexec = cloexec;
289 VTRACE(DBG_REDIR, ("!cloexec\n"));
312 int cloexec;
314 cloexec = fcntl(fd, F_GETFD);
315 if (cloexec >= 0)
316 cloexec &= FD_CLOEXEC;
318 cloexec = 0;
353 fd_rename(sv, fd, i, cloexec);
355 cloexec ? "+" : ""));
377 int eflags, cloexec;
477 cloexec = fd > 2 && (flags & REDIR_KEEP) == 0 && !posix;
480 if (copyfd(f, fd, cloexec, 1) < 0) {
487 } else if (cloexec)
489 VTRACE(DBG_REDIR, ("%s\n", cloexec ? " cloexec" : ""));
631 * cloexec indicates if we want close-on-exec or not.
637 copyfd(int from, int to, int cloexec, int move)
641 if (cloexec && to > 2) {
827 CLOEXEC(to);
927 { "cloexec", 2, O_CLOEXEC },
1072 int n, cloexec;
1077 cloexec = -1;
1079 cloexec = FD_CLOEXEC;
1081 cloexec = 0;
1084 if ((cloexec > 0 && fd <= 2 && (errno = EINVAL)) ||
1085 (cloexec != -1 && fcntl(fd, F_SETFD, (fcntl_int) cloexec) == -1))