READPROC(3)
READPROC(3) π
okay bestie, welcome to the Linux Programmer's Manual β this one's a classic, it's giving very much "reading straight out of /proc" energy. no cap.
β¨ NAME β¨
readproc, freeproc β read information from next /proc/## entry π
π¦ SYNOPSIS π¦
#include <proc/readproc.h>
proc_t* readproc(PROCTAB *PT, proc_t *return_buf);
void freeproc(proc_t *p);
π DESCRIPTION π
so readproc literally reads the info for the next process that matches the criteria you specified over in PT, and fills it all into a proc_t structure. main character behavior fr fr.
now here's the tea on return_buf β β if it's not NULL, it's gonna use the struct that return_buf is pointing at. but if it is NULL? it allocates a brand-new proc_t structure and hands you back a pointer to it. slay.
β οΈ heads up bestie: note that (if so specified inPT)readprocalways allocates memory if it fills in theenvironorcmdlineparts ofproc_t. that memory is yours to deal with, so don't forget it exists π
freeproc frees all the memory allocated for the proc_t struct *p. she's the cleanup crew, the girl who brings the trash bag to the function, we love her π«Ά
the proc_t structure is defined in <proc/readproc.h> β please go look there for a definition of all the fields, i'm not retyping that whole thing, it's giving novella π
β RETURN VALUE β
readproc returns a pointer to the next proc_t, or NULL if there are no more processes left. that's it, that's the ending. no more girlies in the queue π
πΈ SEE ALSO πΈ
openproc(3)readproctab(3)/usr/include/proc/readproc.h/proc/#pid/
π REPORTING BUGS π
found a bug? spill the tea, bestie β please send bug reports to procps@freelists.org π
and that's the whole page, periodt. this little icon was brought to you by the Linux Manpage, dated 14 July 2014 β okurrr, mwah, bye bestie ππ
π¦ where this page comes from
- centos-stream 9: procps-ng-devel 3.3.17-15.el9 Β· GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
- centos-stream 9: procps-ng-devel 3.3.17-15.el9 Β· GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
- ubuntu jammy: procps 2:3.3.17-6ubuntu2 Β· LGPL-2.1-or-later
- ubuntu jammy: procps 2:3.3.17-6ubuntu2.1 Β· LGPL-2.1-or-later
- Copyright 1996 Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de>
- Copyright 2014 Jaromir Capik <jcapik@redhat.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms