48 lines
1.3 KiB
Groff
48 lines
1.3 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g2.getsid @(#)getsid 40.4 of 4/5/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1989, 1990 AT&T
|
|
.\" ident "@(#)svid_ba:ba_os/getsid 1.12"
|
|
.nr X
|
|
.if \nX=0 .ds x} getsid 2 "" "\&"
|
|
.if \nX=1 .ds x} getsid 2 ""
|
|
.if \nX=2 .ds x} getsid 2 "" "\&"
|
|
.if \nX=3 .ds x} getsid "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4getsid\f1 \- get session ID
|
|
.SH SYNOPSIS
|
|
\f4#include <sys/types.h>
|
|
.sp .5
|
|
pid_t getsid(pid_t \f2pid\f4);\f1
|
|
.SH DESCRIPTION
|
|
The function \f4getsid\f1 returns the session ID of the process whose process
|
|
ID is equal to \f2pid\f1.
|
|
If \f2pid\f1 is equal to \f4(pid_t)0\f1, \f4getsid\f1
|
|
returns the session ID of the calling process.
|
|
.SH RETURN VALUE
|
|
Upon successful completion, the function \f4getsid\f1 returns the
|
|
session ID of the specified process; otherwise, it returns
|
|
a value of \f4(pid_t)\-1\f1 and sets \f4errno\f1
|
|
to indicate an error.
|
|
.SH ERRORS
|
|
Under the following conditions, the function \f4getsid\f1 fails
|
|
and sets \f4errno\f1 to:
|
|
.TP 10
|
|
\f4EPERM\f1
|
|
if the process whose process ID is equal to \f2pid\f1 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.
|
|
.TP 10
|
|
\f4ESRCH\f1
|
|
if there is no process with a process ID equal to \f2pid\f1.
|
|
.SH "SEE ALSO"
|
|
.na
|
|
exec(2),
|
|
fork(2),
|
|
getpid(2),
|
|
setpgid(2),
|
|
setsid(2)
|
|
.ad
|