Searched refs:nullfd (Results 1 – 7 of 7) sorted by relevance
/freebsd/lib/libc/gen/ |
H A D | daemon.c | 44 daemonfd(int chdirfd, int nullfd) in daemonfd() argument 83 if (nullfd != -1) { in daemonfd() 84 (void)_dup2(nullfd, STDIN_FILENO); in daemonfd() 85 (void)_dup2(nullfd, STDOUT_FILENO); in daemonfd() 86 (void)_dup2(nullfd, STDERR_FILENO); in daemonfd() 94 int chdirfd, nullfd, ret; in daemon() local 97 nullfd = _open(_PATH_DEVNULL, O_RDWR, 0); in daemon() 99 nullfd = -1; in daemon() 106 ret = daemonfd(chdirfd, nullfd); in daemon() 111 if (nullfd > 2) in daemon() [all …]
|
/freebsd/lib/libcasper/libcasper/ |
H A D | libcasper_impl.c | 51 int nullfd, nfd; in fd_fix_environment() local 56 nullfd = open(_PATH_DEVNULL, O_RDWR); in fd_fix_environment() 57 if (nullfd == -1) in fd_fix_environment() 64 if (dup2(nullfd, *fdp) == -1) in fd_fix_environment() 69 close(nullfd); in fd_fix_environment()
|
/freebsd/usr.sbin/autofs/ |
H A D | popen.c | 79 int error, i, nullfd, outfds[2]; in auto_popen() local 82 nullfd = open(_PATH_DEVNULL, O_RDWR, 0); in auto_popen() 83 if (nullfd < 0) in auto_popen() 117 dup2(nullfd, STDIN_FILENO); in auto_popen() 120 close(nullfd); in auto_popen() 135 close(nullfd); in auto_popen()
|
/freebsd/usr.bin/mail/ |
H A D | collect.c | 332 int nullfd, tempfd, rc; in collect() local 335 if ((nullfd = open(_PATH_DEVNULL, O_RDONLY, 0)) in collect() 353 rc = run_command(sh, 0, nullfd, fileno(fbuf), in collect() 356 close(nullfd); in collect()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/fuzzer/ |
H A D | FuzzerUtilFuchsia.cpp | 599 int nullfd = fdio_bind_to_fd(fdio_null, -1, 0); in DiscardOutput() local 600 if (nullfd < 0) return; in DiscardOutput() 601 dup2(nullfd, Fd); in DiscardOutput()
|
/freebsd/sbin/dhclient/ |
H A D | dhclient.c | 102 static int nullfd = -1; variable 483 if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) in main() 2503 if (daemonfd(-1, nullfd) == -1) in go_daemon() 2515 if (nullfd != -1) { in go_daemon() 2516 close(nullfd); in go_daemon() 2517 nullfd = -1; in go_daemon() 2870 dup2(nullfd, STDIN_FILENO); in fork_privchld() 2871 dup2(nullfd, STDOUT_FILENO); in fork_privchld() 2872 dup2(nullfd, STDERR_FILENO); in fork_privchld() 2873 close(nullfd); in fork_privchld()
|
/freebsd/crypto/openssh/ |
H A D | misc.c | 1533 int nullfd, dupfd; in sanitise_stdfd() local 1535 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { in sanitise_stdfd() 1543 if (dup2(nullfd, dupfd) == -1) { in sanitise_stdfd() 1549 if (nullfd > STDERR_FILENO) in sanitise_stdfd() 1550 close(nullfd); in sanitise_stdfd()
|