summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-17 09:59:52 +0000
committerRoy Marples <roy@marples.name>2008-03-17 09:59:52 +0000
commit50a7697bf207e4919ce893bfc1604fd3a9d807de (patch)
tree1a9c9debaa4d5d862f42c8015826d35b0ce26d7c /man
parent40930d7d0a613aaf6fa124a5963afcae0c30ce7a (diff)
downloadopenrc-50a7697bf207e4919ce893bfc1604fd3a9d807de.tar.gz
openrc-50a7697bf207e4919ce893bfc1604fd3a9d807de.tar.bz2
openrc-50a7697bf207e4919ce893bfc1604fd3a9d807de.tar.xz
rc_find_pids now returns RC_PIDLIST instead of a NULL terminated array.
Diffstat (limited to 'man')
-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