Home
last modified time | relevance | path

Searched refs:nullfd (Results 1 – 7 of 7) sorted by relevance

/freebsd-14.2/lib/libc/gen/
H A Ddaemon.c46 daemonfd(int chdirfd, int nullfd) in daemonfd() argument
85 if (nullfd != -1) { in daemonfd()
86 (void)_dup2(nullfd, STDIN_FILENO); in daemonfd()
87 (void)_dup2(nullfd, STDOUT_FILENO); in daemonfd()
88 (void)_dup2(nullfd, STDERR_FILENO); in daemonfd()
96 int chdirfd, nullfd, ret; in daemon() local
99 nullfd = _open(_PATH_DEVNULL, O_RDWR, 0); in daemon()
101 nullfd = -1; in daemon()
108 ret = daemonfd(chdirfd, nullfd); in daemon()
113 if (nullfd > 2) in daemon()
[all …]
/freebsd-14.2/lib/libcasper/libcasper/
H A Dlibcasper_impl.c51 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-14.2/usr.sbin/autofs/
H A Dpopen.c80 int error, i, nullfd, outfds[2]; in auto_popen() local
83 nullfd = open(_PATH_DEVNULL, O_RDWR, 0); in auto_popen()
84 if (nullfd < 0) in auto_popen()
118 dup2(nullfd, STDIN_FILENO); in auto_popen()
121 close(nullfd); in auto_popen()
136 close(nullfd); in auto_popen()
/freebsd-14.2/usr.bin/mail/
H A Dcollect.c338 int nullfd, tempfd, rc; in collect() local
341 if ((nullfd = open(_PATH_DEVNULL, O_RDONLY, 0)) in collect()
359 rc = run_command(sh, 0, nullfd, fileno(fbuf), in collect()
362 close(nullfd); in collect()
/freebsd-14.2/contrib/llvm-project/compiler-rt/lib/fuzzer/
H A DFuzzerUtilFuchsia.cpp598 int nullfd = fdio_bind_to_fd(fdio_null, -1, 0); in DiscardOutput() local
599 if (nullfd < 0) return; in DiscardOutput()
600 dup2(nullfd, Fd); in DiscardOutput()
/freebsd-14.2/sbin/dhclient/
H A Ddhclient.c102 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-14.2/crypto/openssh/
H A Dmisc.c1498 int nullfd, dupfd; in sanitise_stdfd() local
1500 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { in sanitise_stdfd()
1508 if (dup2(nullfd, dupfd) == -1) { in sanitise_stdfd()
1514 if (nullfd > STDERR_FILENO) in sanitise_stdfd()
1515 close(nullfd); in sanitise_stdfd()