123 lines
2.4 KiB
HTML
123 lines
2.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of READPROC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>READPROC</H1>
|
|
Section: Linux Programmer's Manual (3)<BR>Updated: 14 July 2014<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
readproc, freeproc - read information from next /proc/## entry
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/proc/readproc.h">proc/readproc.h</A>></B>
|
|
|
|
<P>
|
|
<B>proc_t* readproc(PROCTAB *</B><I>PT</I><B>, proc_t *</B><I>return_buf</I><B>);</B>
|
|
|
|
<BR>
|
|
|
|
<B>void freeproc(proc_t *</B><I>p</I><B>);</B>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
<B>readproc</B>
|
|
|
|
reads the information for the next process matching the criteria
|
|
specified in
|
|
<I>PT</I>
|
|
|
|
and fills them into a
|
|
<I>proc_t</I>
|
|
|
|
structure. If
|
|
<I>return_buf</I>
|
|
|
|
is not NULL, it will use the struct pointed at by
|
|
<I>return_buf</I>.
|
|
|
|
Otherwise it will allocate a new
|
|
<I>proc_t</I>
|
|
|
|
structure and return a pointer to it.
|
|
Note that (if so specified in
|
|
<I>PT</I>)
|
|
|
|
readproc always allocates memory if it fills in the
|
|
<I>environ</I> or <I>cmdline</I>
|
|
|
|
parts of
|
|
<I>proc_t</I>.
|
|
|
|
<P>
|
|
<B>freeproc</B>
|
|
|
|
frees all memory allocated for the
|
|
<I>proc_t</I>
|
|
|
|
struct
|
|
<I>*p</I>.
|
|
|
|
<P>
|
|
The
|
|
<I>proc_t</I>
|
|
|
|
structure is defined in
|
|
<I><<A HREF="file:///usr/include/proc/readproc.h">proc/readproc.h</A>></I>,
|
|
|
|
please look there for a definition of all fields.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
<B>readproc</B>
|
|
|
|
returns a pointer to the next
|
|
<I>proc_t</I>
|
|
|
|
or NULL if there are no more processes left.
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+openproc">openproc</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+readproctab">readproctab</A></B>(3),
|
|
|
|
<B>/usr/include/proc/readproc.h</B>,
|
|
|
|
<B>/proc/#pid/</B>,
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>REPORTING BUGS</H2>
|
|
|
|
Please send bug reports to
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">REPORTING BUGS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:54 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|