From 50a7697bf207e4919ce893bfc1604fd3a9d807de Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 17 Mar 2008 09:59:52 +0000 Subject: rc_find_pids now returns RC_PIDLIST instead of a NULL terminated array. --- man/rc_find_pids.3 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'man') diff --git a/man/rc_find_pids.3 b/man/rc_find_pids.3 index 5698e60..1d6aabe 100644 --- a/man/rc_find_pids.3 +++ b/man/rc_find_pids.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Feb 22, 2008 +.Dd Mar 17, 2008 .Dt RC_FIND_PIDS 3 SMM .Os OpenRC .Sh NAME @@ -32,20 +32,22 @@ Run Command library (librc, -lrc) .Sh SYNOPSIS .In rc.h -.Ft "pid_t *" Fo rc_find_pids -.Fa "const char *exec" +.Ft "RC_PIDLIST *" Fo rc_find_pids +.Fa "const char *const *argv" .Fa "const char *cmd" .Fa "uid_t uid" .Fa "pid_t pid" .Fc .Sh DESCRIPTION .Fn rc_find_pids -returns a NULL terminated list of pids for processes matching the given -criteria. If +returns RC_PIDLIST, a structure based on the LIST macro from +.Xr queue 3 +which contains all the pids found matching the given criteria. +If .Fa pid is given then only that pid is returned if it is running. Otherise we check all instances of -.Fa exec +.Fa argv with a process name of .Fa cmd owned by @@ -59,8 +61,10 @@ On BSD systems we use and on Linux systems we use the .Pa /proc filesystem to find our processes. +.Pp +Each RC_PID should be freed in the list as well as the list itself when done. .Sh SEE ALSO .Xr free 3 , -.Xr malloc 3 +.Xr queue 3 .Sh AUTHORS .An "Roy Marples" Aq roy@marples.name -- cgit v1.2.3