summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/setsid.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/setsid.2')
-rw-r--r--lib/libc/sys/setsid.225
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/libc/sys/setsid.2 b/lib/libc/sys/setsid.2
index 48ac6a0..73d437d 100644
--- a/lib/libc/sys/setsid.2
+++ b/lib/libc/sys/setsid.2
@@ -31,36 +31,39 @@
.\"
.\" @(#)setsid.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd "June 4, 1993"
+.Dd June 4, 1993
.Dt SETSID 2
.Os
.Sh NAME
.Nm setsid
.Nd create session and set process group ID
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
+.Fd #include <unistd.h>
.Ft pid_t
.Fn setsid "void"
.Sh DESCRIPTION
The
-.Nm setsid
+.Fn setsid
function creates a new session.
The calling process is the session leader of the new session, is the
process group leader of a new process group and has no controlling
terminal.
The calling process is the only process in either the session or the
process group.
-.Pp
+.Sh RETURN VALUES
Upon successful completion, the
-.Nm setsid
+.Fn setsid
function returns the value of the process group ID of the new process
group, which is the same as the process ID of the calling process.
-.Sh ERRORS
If an error occurs,
-.Nm setsid
+.Fn setsid
returns -1 and the global variable
.Va errno
-is set to indicate the error, as follows:
+is set to indicate the error.
+.Sh ERRORS
+The
+.Fn setsid
+function will fail if:
.Bl -tag -width Er
.It Bq Er EPERM
The calling process is already a process group leader, or the process
@@ -68,12 +71,12 @@ group ID of a process other than the calling process matches the process
ID of the calling process.
.El
.Sh SEE ALSO
-.Xr setpgid 3 ,
+.Xr setpgid 2 ,
.Xr tcgetpgrp 3 ,
.Xr tcsetpgrp 3
.Sh STANDARDS
The
-.Nm setsid
+.Fn setsid
function is expected to be compliant with the
-.St -p1003.1-88
+.St -p1003.1-90
specification.
OpenPOWER on IntegriCloud