PROCTAB* openproc (int flags, ... );
void closeproc (PROCTAB* PT);
The openproc function initializes a PROCTAB structure which can be used by iterated readproc calls to get information on current processes. Depending on flags, openproc may need a second argument or a second and third argument (see below).
closeproc closes all files opened by openproc and deallocates the memory allocated by openproc.
The PROCTAB structure is defined in <proc/readproc.h>
The behaviour of openproc is controlled by the following set of flags, which may be ORed together. There are three different kinds of flags. The first group of flags determins which information gets read from /proc/#pid for each process. The second group of flags (of which only one can be enacted for a opendir call) restricts which processes information is read for by providing a list of criteria. The third group of flags restricts this as well, but doesn't need arguments. These may be used together again.