1GETSID(P)                  POSIX Programmer's Manual                 GETSID(P)
2
3
4

NAME

6       getsid - get the process group ID of a session leader
7

SYNOPSIS

9       #include <unistd.h>
10
11       pid_t getsid(pid_t pid);
12
13

DESCRIPTION

15       The  getsid() function shall obtain the process group ID of the process
16       that is the session leader of the process specified by pid. If  pid  is
17       (pid_t)0, it specifies the calling process.
18

RETURN VALUE

20       Upon  successful completion, getsid() shall return the process group ID
21       of the session leader of the specified process.   Otherwise,  it  shall
22       return (pid_t)-1 and set errno to indicate the error.
23

ERRORS

25       The getsid() function shall fail if:
26
27       EPERM  The  process  specified by pid is not in the same session as the
28              calling process, and the implementation does not allow access to
29              the  process group ID of the session leader of that process from
30              the calling process.
31
32       ESRCH  There is no process with a process ID equal to pid.
33
34
35       The following sections are informative.
36

EXAMPLES

38       None.
39

APPLICATION USAGE

41       None.
42

RATIONALE

44       None.
45

FUTURE DIRECTIONS

47       None.
48

SEE ALSO

50       exec() , fork() , getpid() , getpgid() , setpgid()  ,  setsid()  ,  the
51       Base Definitions volume of IEEE Std 1003.1-2001, <unistd.h>
52
54       Portions  of  this text are reprinted and reproduced in electronic form
55       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
56       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
57       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
58       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
59       event of any discrepancy between this version and the original IEEE and
60       The  Open Group Standard, the original IEEE and The Open Group Standard
61       is the referee document. The original Standard can be  obtained  online
62       at http://www.opengroup.org/unix/online.html .
63
64
65
66IEEE/The Open Group                  2003                            GETSID(P)
Impressum