C Library Functions - system_setsid (3)
NAME
system_setsid(3f) - [M_system:QUERY] create session and set the
process group ID of a session leader
(LICENSE:PD)
CONTENTS
Synopsis
Description
Return Value
Errors
Examples
SYNOPSIS
integer(kind=c_int) function system_setsid(pid)
integer(kind=c_int) :: pid
DESCRIPTION
The setsid() function creates a new session, if the calling
process is not a process group leader. Upon return the calling
process shall be the session leader of this new session, shall be
the process group leader of a new process group, and shall have no
controlling terminal. The process group ID of the calling process
shall be set equal to the process ID of the calling process. The
calling process shall be the only process in the new process
group and the only process in the new session.
RETURN VALUE
Upon successful completion, setsid() shall return the value
of the new process group ID of the calling process. Otherwise,
it shall return -1 and set errno to indicate the error.
ERRORS
The setsid() function shall fail if:
|
|
o
|
The calling process is already a process group leader
|
|
o
|
the process group ID of a process other than the calling
process matches the process ID of the calling process.
|
|
EXAMPLES
Set SID from Fortran
program demo_system_setsid
use M_system, only : system_setsid
implicit none
write(*,*)SID=,system_setsid()
end program demo_system_setsid
Results:
> SID= 484299
| Nemo Release 3.1 | system_setsid (3) | June 29, 2025 |
Generated by manServer 1.08 from 467ce306-f7f0-4b12-b6f4-cd7df7b6c172 using man macros.