PROCPS_PIDS_SORT(3)

NAME
procps_pids_sort - Sort process information

SYNOPSIS
#include <proc/procps.h>

pids_stack **procps_pids_sort(struct pids_info *info, struct pids_stack *stacks[], int numstacked, enum pids_item sortitem, enum pids_sort_order order);

Link with -lprocps.

DESCRIPTION
procps_pids_sort sorts the given stacks stack of process information and sorts it by the given sortitem. numstacked must be the length of the stacks array and all the stacks in the list must be homogenous (of equal length and content). The stacks value can be obtained by a previous call of procps_pids_reap(3) or procps_pids_select(3) and then accessing the stacks member from that structure. order can be either PIDS_SORT_ASCEND or PIDS_SORT_DESCEND.

RETURN VALUE
The function returns the sorted stack on success or NULL on failure.

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

SEE ALSO
libproc(3), procps_pids_new(3), procps_pids_reap(3), procps_pids_select(3), proc(5).