#include <sys/types.h>
#include <qp0wpid.h>
int Qp0wChkPid(pid_t pid,
QP0W_PID_Data_T *pidinfo);
The Qp0wChkPid() function returns the status and process table entry information for the process specified by the process ID pid.
The structure QP0W_PID_Data_T is defined in <qp0wpid.h> header file as follows:
typedef struct QP0W_PID_Data_T {
pid_t pid;
pid_t ppid;
pid_t pgrp;
int status;
unsigned int exit_status;
} QP0W_PID_Data_T;
The members of the QP0W_PID_Data_T structure are as follows:
| pid_t pid; | The process ID of the process. |
||||||||
| pid_t ppid; | The process ID of the parent process. If
ppid has a value of binary 1, there is no parent process
associated with the process. |
||||||||
| pid_t pgrp; | The process group ID of the process. |
||||||||
| int status; | A collection of flag bits that describe the
current state of the process. The following flag bits can be set in
status:
|
||||||||
| unsigned int exit_status; | Exit status of the process. This member only has
meaning if the status has been set to
QP0W_PID_TERMINATED. Refer to the wait() function
for a description of the exit status for a process. |
The process calling Qp0wChkPid() must have the appropriate authority to the process being examined. A process is allowed to examine the process table information for a process if at least one of the following conditions is true:
| 0 | Qp0wChkPid() was successful. | ||||||
| value | Qp0wChkPid() was not successful.
The value returned indicates one of the following errors. Under some
conditions, value could indicate an error other than those listed
here.
|
The Qp0wChkPid() function provides an i5/OS-specific way to obtain the process table information for the specified process.
| Top | UNIX-Type APIs | APIs by category |