DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

getsid(S-osr5)


getsid -- get session ID

Syntax

cc . . . -lc
#include <unistd.h>

pid_t getsid(pid_t pid);

Description

The function getsid returns the session ID of the process whose process ID is equal to pid. If pid is equal to (pid_t)0, getsid returns the session ID of the calling process.

Return values

On success, getsid returns the session ID of the specified process. On failure, getsid returns (pid_t)-1 and sets errno to identify the error.

Diagnostics

In the following conditions, getsid fails and sets errno to:

[EPERM]
The process whose process ID is equal to pid is not in the same session as the calling process, and the implementation does not allow access to the session ID of that process from the calling process.

[ESRCH]
There is no process with a process ID equal to pid.

Files


/lib/libc.a
linking library

See also

exec(S-osr5), fork(S-osr5), getpid(S-osr5), setpgid(S-osr5), setsid(S-osr5)

Standards conformance

getsid is conformant with:

AT&T SVID Issue 3.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005