1READPROC(3) Linux Programmer's Manual READPROC(3)
2
3
4
6 readproc, freeproc - read information from next /proc/## entry
7
9 #include <proc/readproc.h>
10
11 proc_t* readproc(PROCTAB *PT, proc_t *return_buf);
12 void freeproc(proc_t *p);
13
14
16 readproc reads the information for the next process matching the crite‐
17 ria specified in PT and fills them into a proc_t structure. If
18 return_buf is not NULL, it will use the struct pointed at by
19 return_buf. Otherwise it will allocate a new proc_t structure and
20 return a pointer to it. Note that (if so specified in PT) readproc
21 always allocates memory if it fills in the environ or cmdline parts of
22 proc_t.
23
24 freeproc frees all memory allocated for the proc_t struct *p.
25
26 The proc_t structure is defined in <proc/readproc.h>, please look there
27 for a definition of all fields.
28
29
31 readproc returns a pointer to the next proc_t or NULL if there are no
32 more processes left.
33
34
36 openproc(3), readproctab(3), /usr/include/proc/readproc.h, /proc/#pid/,
37
39 Please send bug reports to ⟨procps@freelists.org⟩
40
41
42
43Linux Manpage 14 July 2014 READPROC(3)