system_getsid Interface

interface

NAME

    system_getsid(3f) - [M_system:QUERY] get the process group ID of
                        a session leader
    (LICENSE:PD)

SYNOPSIS

    integer(kind=c_int) function system_getsid(pid)
    integer(kind=c_int) :: pid

DESCRIPTION

    The system_getsid() function obtains the process group ID of the
    process that is the session leader of the process specified by pid.
    If pid is 0, it specifies the calling process.

RETURN VALUE

    Upon successful completion, system_getsid() shall return
    the process group ID of the session leader of the specified
    process. Otherwise, it shall return -1 and set errno to indicate
    the error.

EXAMPLE

Get SID from Fortran

program demo_system_getsid
use M_system,      only : system_getsid
use ISO_C_BINDING, only : c_int
implicit none
   write(*,*)'SID=',system_getsid(0_c_int)
end program demo_system_getsid

public function system_getsid(c_pid) bind(C,name="getsid")

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int) :: c_pid

Return Value integer(kind=c_int)