Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setsid(2) [minix man page]

SETSID(2)							System Calls Manual							 SETSID(2)

NAME
setsid, getpgrp - create process group, get process group id SYNOPSIS
#include <sys/types.h> #include <unistd.h> pid_t setsid(void) pid_t getpgrp(void) DESCRIPTION
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 fork(). Getpgrp() returns the process group ID of the calling process. SEE ALSO
kill(2), termios(3), tty(4). DIAGNOSTICS
Setsid() returns the new process group ID on success, or -1 with errno set to EPERM if the process is already a session leader. AUTHOR
Kees J. Bot (kjb@cs.vu.nl) SETSID(2)

Check Out this Related Man Page

SETSID(2)						      BSD System Calls Manual							 SETSID(2)

NAME
setsid -- create session and set process group ID LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> pid_t setsid(void); DESCRIPTION
The setsid() function creates a new session. The calling process is the session leader of the new session, is the process group leader of a new process group and has no controlling terminal. The calling process is the only process in either the session or the process group. Upon successful completion, the setsid() function returns the value of the process group ID of the new process group, which is the same as the process ID of the calling process. ERRORS
If an error occurs, setsid() returns -1 and the global variable errno is set to indicate the error, as follows: [EPERM] The calling process is already a process group leader, or the process group ID of a process other than the calling process matches the process ID of the calling process. SEE ALSO
getsid(2), setpgid(2), tcgetpgrp(3), tcsetpgrp(3) STANDARDS
The setsid() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''). BSD
April 4, 2011 BSD
Man Page

Featured Tech Videos