readproc(3)

readproc3

Read information from next /proc/## entry

Usage

#include <proc/readproc.h>

proc_t* readproc(PROCTAB *PT, proc_t *return_buf);
void freeproc(proc_t *p);

Overview

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.

Releases

5 releases since Debian 1.2 (Rex); the text changed 1 time.

  1. 1.2–1.3
  2. 9–11

Reporting bugs

Please send bug reports to ⟨[email protected]⟩

From procps 2:3.3.17-5 in Debian 11 (Bullseye). Parsed by carta from the page's man source.