Visible to Intel only — GUID: GUID-0734999F-3BF3-4798-9DB6-309FC4C59126
Visible to Intel only — GUID: GUID-0734999F-3BF3-4798-9DB6-309FC4C59126
PXFEXIT, PXFFASTEXIT
POSIX Subroutine: Exits from a process.
Module
USE IFPOSIX
CALL PXFEXIT (istatus)
CALL PXFFASTEXIT (istatus)
istatus |
(Input) INTEGER(4). The exit value. |
The PXFEXIT subroutine terminates the calling process. It calls, in last-in-first-out (LIFO) order, the functions registered by C runtime functions atexit and onexit, and flushes all file buffers before terminating the process. The istatus value is typically set to zero to indicate a normal exit and some other value to indicate an error.
The PXFFASTEXIT subroutine terminates the calling process without processing atexit or onexit, and without flushing stream buffers.
Example
program t1
use ifposix
integer(4) ipid, istat, ierror, ipid_ret, istat_ret
print *," the child process will be born"
call PXFFORK(IPID, IERROR)
call PXFGETPID(IPID_RET,IERROR)
if(IPID.EQ.0) then
print *," I am a child process"
print *," My child's pid is", IPID_RET
call PXFGETPPID(IPID_RET,IERROR)
print *," The pid of my parent is",IPID_RET
print *," Now I have exited with code 0xABCD"
call PXFEXIT(Z'ABCD')
else
print *," I am a parent process"
print *," My parent pid is ", IPID_RET
print *," I am creating the process with pid", IPID
print *," Now I am waiting for the end of the child process"
call PXFWAIT(ISTAT, IPID_RET, IERROR)
print *," The child with pid ", IPID_RET," has exited"
if( PXFWIFEXITED(ISTAT) ) then
print *, " The child exited normally"
istat_ret = IPXFWEXITSTATUS(ISTAT)
print 10," The low byte of the child exit code is", istat_ret
end if
end if
10 FORMAT (A,Z)
end program