NAME

lkmi_readprocesses


SYNOPSIS

#include <lkmi.h >

pid_t *lkmi_readprocesses (int *pN);


PARAMETERS

pN
Pointer to integer, where is returned number of actual processes.


DESCRIPTION

lkmi_readprocesses reads from /proc directory pids of currently allocated processes.


RETURN VALUE

If function fails then is returned NULL pointer. In this case is value referred by parameter pN invalid and errno value is appropriately set.

Sometimes this function can detect not enough memory during its executing. In this case is errno set to ENOMEM and array is returned unsorted.

If function end successfully then errno is set to zero and array of pids is sorted.

EINVAL
Passed pointer to pN is NULL.

ENOENT
Directory /proc is not mounted or proc filesystem is not included in the kernel.

ENOMEM
Not enough memory to complete the operation.

If function ends successfully then is returned sorted array of pids and value referred by parameter pN contains size of array (Number of pids).

Note: If valid pointer is returned, then it must be freed by free (3) function.


BUGS REPORTING

Please use the SourceForge Reporting page which is located here:

Bug Report


COPYRIGHT

This function is written as part of lkmi library for Linux system and may be freely distributed under GPL terms.

Copyright (c) 1995, 2002 David Doubrava (linux_monitor(at)volny(dot)cz).


SEE ALSO

Origin of values description is in Linux kernel source.

lkmi, lkmi_cpu, lkmi_files, lkmi_filesys, lkmi_hdd, lkmi_hw_intr, lkmi_inodes, lkmi_memory, lkmi_memoryswap, lkmi_net, lkmi_proc, lkmi_readprocesses.html, lkmi_swap, lkmi_swapex, lkmi_system