pxfwait(3F)

PXFWAIT, PXFWAITPID - Obtains information about a calling process' child process

As shipped in IRIX 6.5.15. Last changed in IRIX 6.5.5.

NAME
     PXFWAIT, PXFWAITPID - Obtains information about a calling process'
     child process

SYNOPSIS
     SUBROUTINE PXFWAIT (istat, iretpid, ierror)
     INTEGER istat, iretpid, ierror

     SUBROUTINE PXFWAITPID (ipid, istat, ioptions, iretpid, ierror)
     INTEGER ipid, istat, ioptions, iretpid, ierror

IMPLEMENTATION
     UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
     On IRIX systems, 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 PXFWAIT routine uses the wait(2) system call to obtain information
     about one of the calling process's child processes.

     The PXFWAITPID routine uses the waitpid(2) system call to obtain
     information about one of the calling process's child processes.

     When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
     UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
     kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
     kind is KIND=8 for integer, real, complex, and logical arguments; on
     IRIX, the default kind is KIND=4.

     The following is a list of arguments for this routine:

     ipid      An input integer variable containing the child process ID
               for which information is requested.

               * If ipid is equal to -1, status is requested for any child
                 process; PXFWAITPID is then equivalent to PXFWAIT.

               * If ipid is greater than 0, it specifies the process ID of
                 a single child process for which status is requested.

               * If ipid is equal to 0, status is requested for any child
                 process with a process group ID that is equal to that of
                 the calling process.

               * If ipid is less than -1, status is requested for any child
                 process with a process group ID that is equal to the
                 absolute value of ipid.

     istat     An output integer variable for the status information.

     ioptions  An input integer variable constructed from an inclusive OR
               of zero or more of the following options:

               WNOHANG     The waitpid system call does not suspend
                           execution of the calling process if status is
                           not immediately available for one of the calling
                           processes specified by pid.

               WUNTRACED   If job control is supported, the status of any
                           child processes specified by pid that are
                           stopped, and with a status that has not yet been
                           reported since they stopped, are also reported
                           to the requesting process.

               UNICOS and UNICOS/mk systems only:

               WMTWAIT     Waits for the children of any member of the
                           multitasking group.  In UNICOS 9.0 this is the
                           default behavior for both wait and waitpid.  The
                           flag is still provided for source compatibility.
                           To get the previous behavior, see the
                           description of the WLWPWAIT flag.

               WLWPWAIT    Waits only for the immediate children of the
                           calling light-weight process (LWP).  This flag
                           is not recommended for general use.

     iretpid   An output integer variable for the child process ID.

     ierror    An output integer variable that contains zero if the routine
               was successful or nonzero if the routine was not successful.

     Any of the following error values may be returned:

     ECHILD    PXFWAIT: If the calling process has no existing unwaited-for
               child processes.
               PXFWAITPID:  The process or process group specified by ipid
               does not exist or is not a child of the calling process.

     EINTR     If receipt of a signal other than the death-of-a-child-
               process signal.

     EINVAL    The value of the ioptions argument is not valid.

EXAMPLES
   PXFWAIT example:
          program pxftest
          integer istat, iretpid, ipid, ierror, i, j

          CALL PXFFORK(ipid,ierror)
          if (ierror .ne. 0) then
              print *,'FAILED: PXFFORK call failed with error = ',ierror
          else
              if (ipid .eq. 0) then
                 j = 0
                 do i=1,100000
                    j = j + i
                 enddo
                 stop
              else
                 CALL PXFWAIT(istat,iretpid,ierror)
                 if (ierror .eq. 0) then
                     print *,'PASSED: PXFWAIT normal test'
                 else
                     print *,'FAILED: PXFWAIT call with error = ',ierror
                 endif
              endif
          endif
          end

   PXFWAITPID example:
          program pxftest
          integer istat, iretpid, ipid, ierror, i, j, ioptions

          CALL PXFFORK(ipid,ierror)
          if (ierror .ne. 0) then
             print *,'FAILED: PXFFORK call failed with error = ',ierror
          else
             if (ipid .eq. 0) then
                j = 0
                do i=1,100000
                   j = j + i
                enddo
                stop
             else
                ioptions = 0
                CALL PXFWAITPID(ipid,istat,ioptions,iretpid,ierror)
                if (ierror .eq. 0) then
                   print *,'PASSED: PXFWAITPID normal test'
                else
                   print *,'FAILED: PXFWAITPID call with error = ',ierror
                endif
             endif
          endif
          end

SEE ALSO
     wait(2), waitpid(2)

     Application Programmer's Library Reference Manual for the printed
     version of this man page.