diff --git a/man2/getsid.2 b/man2/getsid.2 index 6443ec555..2f8fab915 100644 --- a/man2/getsid.2 +++ b/man2/getsid.2 @@ -1,4 +1,5 @@ .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2016 Michael Kerrisk .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or @@ -50,11 +51,14 @@ _XOPEN_SOURCE\ >=\ 500 .SH DESCRIPTION .I getsid(0) returns the session ID of the calling process. -.I getsid(p) +.BR getsid () returns the session ID of the process with process ID -.IR p . -(The session ID of a process is the process ID of the -session leader.) +.IR pid . +If +.I pid +is 0, +.BR getsid () +returns the session ID of the calling process. .SH RETURN VALUE On success, a session ID is returned. On error, \fI(pid_t)\ \-1\fP will be returned, and @@ -81,6 +85,10 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .SH NOTES Linux does not return .BR EPERM . + +See +.BR credentials (7) +for a description of sessions and session IDs. .SH SEE ALSO .BR getpgid (2), .BR setsid (2),