~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "GETSID" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" getsid 
4
.SH NAME
5
getsid \- get the process group ID of a session leader
6
.SH SYNOPSIS
7
.LP
8
\fB#include <unistd.h>
9
.br
10
.sp
11
pid_t getsid(pid_t\fP \fIpid\fP\fB); \fP
12
\fB
13
.br
14
\fP
15
.SH DESCRIPTION
16
.LP
17
The \fIgetsid\fP() function shall obtain the process group ID of the
18
process that is the session leader of the process
19
specified by \fIpid\fP. If \fIpid\fP is (\fBpid_t\fP)0, it specifies
20
the calling process.
21
.SH RETURN VALUE
22
.LP
23
Upon successful completion, \fIgetsid\fP() shall return the process
24
group ID of the session leader of the specified process.
25
Otherwise, it shall return (\fBpid_t\fP)-1 and set \fIerrno\fP to
26
indicate the error.
27
.SH ERRORS
28
.LP
29
The \fIgetsid\fP() function shall fail if:
30
.TP 7
31
.B EPERM
32
The process specified by \fIpid\fP is not in the same session as the
33
calling process, and the implementation does not allow
34
access to the process group ID of the session leader of that process
35
from the calling process.
36
.TP 7
37
.B ESRCH
38
There is no process with a process ID equal to \fIpid\fP.
39
.sp
40
.LP
41
\fIThe following sections are informative.\fP
42
.SH EXAMPLES
43
.LP
44
None.
45
.SH APPLICATION USAGE
46
.LP
47
None.
48
.SH RATIONALE
49
.LP
50
None.
51
.SH FUTURE DIRECTIONS
52
.LP
53
None.
54
.SH SEE ALSO
55
.LP
56
\fIexec\fP() , \fIfork\fP() , \fIgetpid\fP() , \fIgetpgid\fP() , \fIsetpgid\fP()
57
, \fIsetsid\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
58
\fI<unistd.h>\fP
59
.SH COPYRIGHT
60
Portions of this text are reprinted and reproduced in electronic form
61
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
62
-- Portable Operating System Interface (POSIX), The Open Group Base
63
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
64
Electrical and Electronics Engineers, Inc and The Open Group. In the
65
event of any discrepancy between this version and the original IEEE and
66
The Open Group Standard, the original IEEE and The Open Group Standard
67
is the referee document. The original Standard can be obtained online at
68
http://www.opengroup.org/unix/online.html .