readproc (3)
Leading comments
This file describes the readproc interface to the /proc filesystem Copyright 1996 Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Copyright 2014 Jaromir Capik <jcapik@redhat.com> Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resul...
NAME
readproc, freeproc - read information from next /proc/## entrySYNOPSIS
#include <proc/readproc.h>
proc_t* readproc(PROCTAB *PT, proc_t *return_buf);
void freeproc(proc_t *p);
DESCRIPTION
readproc reads the information for the next process matching the criteria specified in PT and fills them into a proc_t structure. If return_buf is not NULL, it will use the struct pointed at by return_buf. Otherwise it will allocate a new proc_t structure and return a pointer to it. Note that (if so specified in PT) readproc always allocates memory if it fills in the environ or cmdline parts of proc_t.
freeproc frees all memory allocated for the proc_t struct *p.
The proc_t structure is defined in <proc/readproc.h>, please look there for a definition of all fields.
RETURN VALUE
readproc returns a pointer to the next proc_t or NULL if there are no more processes left.