pxfsetsid(3F)
PXFSETSID - Creates a new session for a calling process
As shipped in IRIX 6.5.19. Last changed in IRIX 6.5.19.
NAME PXFSETSID - Creates a new session for a calling process SYNOPSIS SUBROUTINE PXFSETSID (isid, ierror) INTEGER isid, ierror DESCRIPTION This routine is in libfortran.so which is linked by default when compiling programs with the MIPSpro 7 Fortran 90 compiler or when compiling programs with the -craylibs option to the MIPSpro F77 compiler. The PXFSETSID routine uses the setsid(2) system call to create a new session for the calling process. The calling process must not be the process leader for PXFSETSID to be successful. After the successful completion of PXFSETSID, the calling process will be the session leader for the new session and the process group leader for the new process group. The calling process also will have no controlling terminal. All arguments must be of default kind unless documented otherwise. On IRIX systems, the default kind is KIND=4. The following is a list of arguments for this routine: isid An output integer variable for the new process group ID of the calling process. ierror An output integer variable that contains zero if PXFSETSID was successful or nonzero if PXFSETSID was not successful. This routine may return the EPERM error value if the calling process is already a process group leader, or the calling process group ID of a process other than the calling process matches the process ID of the calling process. NOTES The PXF_DEFINITIONS module can be used by Fortran 90 users to enable caller-callee interface checking. EXAMPLES In this example, PXFFORK(3F) is called to create a child process, which calls PXFSETSID to create a new session. The child writes the value of ierror to Fortran unit 10 and stops. After the fork, the parent process waits for the child to finish execution, and then reads from Fortran unit 10. If the value read in from unit 10 is not equal to zero, the child's call to PXFSETSID was unsucessful. program pxftest integer isid, iretpid, istat, ierror, i CALL PXFFORK(iretpid,ierror) if (ierror .ne. 0) then print *,'FAILED: PXFFORK call with error = ',ierror else if (iretpid .eq. 0) then CALL PXFSETSID(isid, ierror) write (10,*) ierror stop else CALL PXFWAIT(istat, iretpid, ierror) read (10,*) i if (i .eq. 0) then print *,'PASSED: PXFSETSID call under normal conditions' else print *,'FAILED: PXFSETSID call with error = ',i endif endif endif SEE ALSO setsid(2) PXFFORK(3F)