introspection_get_all_child_pids()
Get a list of PIDs for all children of a process
Synopsis:
#include <sys/introspection.h>
int introspection_get_all_child_pids( pid64_t parent_pid,
pid64_t *const buffer,
const size_t bsize );
Arguments:
- parent_pid
- The PID (pid_t) or unique PID (pid64_t) of the parent process.
- buffer
- The buffer to store the child PIDs.
- bsize
- The size of the buffer, in bytes.
Library:
libintrospection
Use the -l introspection option to qcc to link against this library.
Description:
The introspection_get_all_child_pids() function fills the buffer with a list of child PIDs of a given process.
Note:
Your process must have the
PROCMGR_AID_XPROCESS_QUERY ability enabled to request information
about another process.
Returns:
The required number of bytes to store all PIDs, on success. The buffer is filled with as many complete PIDs that will fit. If an error occurs, the function returns the negative of a value from the Errors section.
Errors:
- EFAULT
- Error accessing the output buffer.
- EPERM
- The calling process doesn't have the required ability.
- ESRCH
- The parent ID is invalid.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Signal handler | Yes |
| Thread | Yes |
Page updated:
