up | Inhaltsverzeichniss | Kommentar

Manual page for SETSID(2P)

setsid - (POSIX only) create session and set process group ID

SYNOPSIS

#include <sys/types.h>

pid_t setsid(void);

DESCRIPTION

The information in this specification applies only to POSIX applications.

If the calling process is not a process group leader, the setsid function creates a new session. The calling process is the session leader of the new session, the process group leader of a new process group, and has no controlling terminal. The process group ID of the calling process is set to the process ID of the calling process. The calling process is the only process in the new process group and the only process in the new session.

RETURN VALUE

A successful call to setsid returns the value of the process group ID of the calling process. A value of -1 indicates that an error occurred, and the error code is stored in the global variable errno.

ERRORS

A possible error for setsid is:
[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

execve(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2P), sigaction(2P)


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97