create session and set process ID
cc . . . -lc
pid_t setsid (void);
If the calling process is not already a process group leader, the
routine creates a new session.
After the routine is called,
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. 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
in the new session.
Upon successful completion,
returns the value of the process group
ID of the calling process.
If the routine fails,
returns a value of -1 and
is set to indicate the appropriate error.
If the following condition occurs,
routine fails and
is set to the corresponding value:
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.
setsid conforms with:
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
NIST FIPS 151-1
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003