up | Inhaltsverzeichniss | Kommentar

Manual page for SETSID(2V)

setsid - create session and set process group ID

SYNOPSIS

#include <sys/types.h>

pid_t setsid()

DESCRIPTION

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 this new session, the process group leader of a new process group, and has no controlling terminal. If the process had a controlling terminal, setsid() breaks the association between the process and that controlling terminal. The process group ID of the calling process is set equal 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 VALUES

setsid() returns the process group ID of the calling process on success. On failure, it returns -1 and sets errno to indicate the error.

ERRORS

If any of the following conditions occur, setsid() returns -1 and sets errno to the corresponding value:

EPERM
The calling process is already a process group leader.

The process ID of the calling process equals the process group ID of a different process.

SEE ALSO

execve.2v exit.2v fork.2v getpid.2v getpgrp.2v kill.2v setpgid.2v sigaction.3v


index | Inhaltsverzeichniss | Kommentar

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