diff options
Diffstat (limited to 'upstream/debian-bookworm/man2/getsid.2')
-rw-r--r-- | upstream/debian-bookworm/man2/getsid.2 | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/upstream/debian-bookworm/man2/getsid.2 b/upstream/debian-bookworm/man2/getsid.2 new file mode 100644 index 00000000..aad2cb45 --- /dev/null +++ b/upstream/debian-bookworm/man2/getsid.2 @@ -0,0 +1,74 @@ +.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl) +.\" and Copyright (C) 2016 Michael Kerrisk <mtk.manpages@gmail.com> +.\" +.\" SPDX-License-Identifier: GPL-2.0-or-later +.\" +.\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond <esr@y\thyrsus.com> +.\" Modified 2001-12-17, aeb +.TH getsid 2 2022-12-04 "Linux man-pages 6.03" +.SH NAME +getsid \- get session ID +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.B #include <unistd.h> +.PP +.BI "pid_t getsid(pid_t" " pid" ); +.fi +.PP +.RS -4 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.RE +.PP +.BR getsid (): +.nf + _XOPEN_SOURCE >= 500 +.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED + || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L +.fi +.SH DESCRIPTION +.BR getsid () +returns the session ID of the process with process ID +.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 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EPERM +A process with process ID +.I pid +exists, but it is not in the same session as the calling process, +and the implementation considers this an error. +.TP +.B ESRCH +No process with process ID +.I pid +was found. +.SH VERSIONS +This system call is available since Linux 2.0. +.\" Linux has this system call since Linux 1.3.44. +.\" There is libc support since libc 5.2.19. +.SH STANDARDS +POSIX.1-2001, POSIX.1-2008, SVr4. +.SH NOTES +Linux does not return +.BR EPERM . +.PP +See +.BR credentials (7) +for a description of sessions and session IDs. +.SH SEE ALSO +.BR getpgid (2), +.BR setsid (2), +.BR credentials (7) |