summaryrefslogtreecommitdiff
path: root/man/rc_find_pids.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/rc_find_pids.3')
-rw-r--r--man/rc_find_pids.318
1 files changed, 11 insertions, 7 deletions
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