introspection_allocate_and_get_all_pids()
Get a list of PIDs
Synopsis:
#include <sys/introspection.h>
int introspection_allocate_and_get_all_pids( pid64_t **plist,
size_t *pnumber_of_pids );
Arguments:
- plist
- A pointer to a location to store the list of PIDs.
- pnumber_of_pids
- A pointer to a variable where the number of PIDs in the allocated list can be stored.
Library:
libintrospection
Use the -l introspection option to qcc to link against this library.
Description:
The introspection_allocate_and_get_all_pids() function allocates a buffer and fills it with a list of PIDs. If new processes are being created when this function is called, it may give up and return EAGAIN instead.
On success, the calling process is responsible for freeing the buffer.
Returns:
EOK on success. If an error occurs, the function returns a value from the Errors section.
Errors:
- EAGAIN
- New processes were being created when the function was called.
- ENOMEM
- Insufficient memory to allocate the list of PIDs.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Signal handler | No |
| Thread | Yes |
Page updated:
