From 3d8af6034724aac8133d0c84196536c7ba89639e Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 12 Sep 2016 07:09:29 +0100 Subject: [PATCH] getsid.2: Rework description to be somewhat clearer Signed-off-by: Michael Kerrisk --- man2/getsid.2 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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),