PROCPS_PIDS_NEW(3)

NAME
procps_pids_new - Create a PID information structure

SYNOPSIS
#include <proc/procps.h>

int procps_pids_new(struct pids_info **info, enum pids_item *items, int numitems);

Link with -lprocps.

DESCRIPTION
procps_pids_new() creates a new PID information structure that be used in subsequent calls to procps_pids_get(3), procps_pids_reap(3), procps_pids_reset(3), procps_pids_select(3), procps_pids_sort(3). functions. The pointer to info will have memory allocated and a structure created. items is an array of enums up to numitems long that selects what information about the processed will be stored. numitems is used to allocate memory and must be at least the length of items but can be more. For information about what items can contain, see the PID ITEMS section in libproc(3). Once the structure is no longer required, procps_pids_unref(3) should be used to free it.

RETURN VALUE
The function returns 0 on success and one of negative values below on failure.

-EINVAL
    One of the given parameters is incorrect.

-ENOMEM
    Unable to allocate memory for the structure.

VERSIONS
procps_pids_new() first appeared in libproc-2 version 0.0.

SEE ALSO
libproc(3), procps_pids_reap(3), procps_pids_reset(3), procps_pids_select(3), procps_pids_sort(3), procps_pids_unref(3), proc(5).