Repository navigation
Expand file tree
/
Copy pathsetsid.2
More file actions
40 lines (38 loc) · 927 Bytes
/
Copy pathsetsid.2
File metadata and controls
40 lines (38 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
5CF1
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.TH SETSID 2
.SH NAME
setsid, getpgrp \- create process group, get process group id
.SH SYNOPSIS
.ft B
.nf
#include <sys/types.h>
#include <unistd.h>
pid_t setsid(void)
pid_t getpgrp(void)
.fi
.ft P
.SH DESCRIPTION
.B Setsid()
creates a new session if the calling process is not already a session
leader. The calling process becomes the session leader of a new process
group and the process group ID of this new process group will be equal to
the process ID of the new session leader. The process group ID is inherited
on a
.BR fork (2).
.PP
.B Getpgrp()
returns the process group ID of the calling process.
.SH "SEE ALSO"
.BR kill (2),
.BR termios (3),
.BR tty (4).
.SH DIAGNOSTICS
.B Setsid()
returns the new process group ID on success, or \-1 with
.B errno
set to
.B EPERM
if the process is already a session leader.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
.\"
.\" $PchId: setsid.2,v 1.2 1996/04/11 06:06:36 philip Exp $