Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

PXFWAITPID

POSIX Subroutine: Waits for a specific PID. This routine is only available for Linux.

Module

USE IFPOSIX

CALL PXFWAITPID (ipid,istat,ioptions,iretpid,ierror)

ipid

(Input) INTEGER(4). The PID to wait for. One of the following values:

Value

Action

< -1

Specifies to wait for any child process whose process group ID is equal to the absolute value of ipid.

-1

Specifies to wait for any child process; this is the same behavior as PXFWAIT.

0

Specifies to wait for any child process whose process group ID is equal to that of the calling process.

> 0

Specifies to wait for the child whose process ID is equal to the value of ipid.

istat

(Output) INTEGER(4). The returned status of the child process.

ioptions

(Input) INTEGER(4). One or more of the following constant values (which can be passed to PXFCONST or IPXFCONST):

Value

Action

WNOHANG

Specifies to return immediately if no child process has exited.

WUNTRACED

Specifies to return for child processes that have stopped, and whose status has not been reported.

iretpid

(Output) INTEGER(4). The PID of the stopped child process.

ierror

(Output) INTEGER(4). The error status.

If successful, ierror is set to zero; otherwise, an error code.

The PXFWAITPID subroutine suspends execution of the current process until the child specified by ipid has exited, or until a signal is delivered whose action terminates the current process or calls a signal handling routine. If the child specified by ipid has already exited by the time of the call (a "zombie" process), a return is immediately made. Any system resources used by the child are freed.

The returned value in istat can be used in subroutines IPXFWEXITSTATUS, IPXFWSTOPSIG, IPXFWTERMSIG, PXFWIFEXITED, PXFWIFSIGNALLED, and PXFWIFSTOPPED.