summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/daemon.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/daemon.3')
-rw-r--r--lib/libc/gen/daemon.312
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/gen/daemon.3 b/lib/libc/gen/daemon.3
index 1905923..afbbee2 100644
--- a/lib/libc/gen/daemon.3
+++ b/lib/libc/gen/daemon.3
@@ -37,6 +37,8 @@
.Nm daemon
.Nd run in the background
.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft int
.Fn daemon "int nochdir" "int noclose"
.Sh DESCRIPTION
.Pp
@@ -58,17 +60,19 @@ is non-zero,
will redirect standard input, standard output and standard error
to ``/dev/null''.
.Sh ERRORS
-The function
+If an error occurs,
.Fn daemon
-may fail and set
+returns -1 and sets the global variable
.Va errno
-for any of the errors specified for the library functions
+to any of the errors specified for the library functions
.Xr fork 2
and
.Xr setsid 2 .
.Sh SEE ALSO
+.Xr fork 2 ,
.Xr setsid 2
.Sh HISTORY
The
.Fn daemon
-function first appeared in 4.4BSD.
+function first appeared in
+.Bx 4.4 .
OpenPOWER on IntegriCloud