daemon.3: Clarify discussion of 'noclose' and 'nochdir' arguments

Reported-by: Doug Goldstein <cardoe@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2009-05-02 16:29:00 +12:00
parent 7e05b05eca
commit 5a76509a2e
1 changed files with 11 additions and 8 deletions

View File

@ -31,7 +31,7 @@
.\"
.\" @(#)daemon.3 8.1 (Berkeley) 6/9/93
.\" Added mentioning of glibc weirdness wrt unistd.h. 5/11/98, Al Viro
.TH DAEMON 3 2009-02-23 "GNU" "Linux Programmer's Manual"
.TH DAEMON 3 2009-05-02 "GNU" "Linux Programmer's Manual"
.SH NAME
daemon \- run in the background
.SH SYNOPSIS
@ -52,18 +52,21 @@ The
function is for programs wishing to detach themselves from the
controlling terminal and run in the background as system daemons.
.PP
Unless the argument
If
.I nochdir
is non-zero,
is zero,
.BR daemon ()
changes the current working directory to the root directory ("/").
changes the process's current working directory
to the root directory ("/");
otherwise,
.PP
Unless the argument
If
.I noclose
is non-zero,
is zero,
.BR daemon ()
will redirect standard input, standard output and standard error
to \fI/dev/null\fP.
redirects standard input, standard output and standard error
to \fI/dev/null\fP;
otherwise, no changes are made to these file descriptors.
.SH "RETURN VALUE"
(This function forks, and if the
.BR fork (2)