# phpman > man > readproc(3)

[READPROC(3)](https://www.chedong.com/phpMan.php/man/READPROC/3/markdown)                           Linux Programmer's Manual                          [READPROC(3)](https://www.chedong.com/phpMan.php/man/READPROC/3/markdown)



## 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
       **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.


## SEE ALSO
       [**openproc**(3)](https://www.chedong.com/phpMan.php/man/openproc/3/markdown), [**readproctab**(3)](https://www.chedong.com/phpMan.php/man/readproctab/3/markdown), **/usr/include/proc/readproc.h**, **/proc/#pid/**,

## REPORTING BUGS
       Please send bug reports to ⟨<procps@freelists.org>⟩



Linux Manpage                               14 July 2014                                 [READPROC(3)](https://www.chedong.com/phpMan.php/man/READPROC/3/markdown)
