66 lines
2.4 KiB
Groff
66 lines
2.4 KiB
Groff
|
.\" (C) Copyright 2017 Craig Small <csmall@enc.com.au>
|
||
|
.\"
|
||
|
.\" %%%LICENSE_START(LGPL_2.1+)
|
||
|
.\" This manual is free software; you can redistribute it and/or
|
||
|
.\" modify it under the terms of the GNU Lesser General Public
|
||
|
.\" License as published by the Free Software Foundation; either
|
||
|
.\" version 2.1 of the License, or (at your option) any later version.
|
||
|
.\"
|
||
|
.\" This manual is distributed in the hope that it will be useful,
|
||
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
.\" Lesser General Public License for more details.
|
||
|
.\"
|
||
|
.\" You should have received a copy of the GNU Lesser General Public
|
||
|
.\" License along with this library; if not, write to the Free Software
|
||
|
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
|
.\" %%%LICENSE_END
|
||
|
.\"
|
||
|
.TH PROCPS_PIDS_select 3 2017-01-05 "libproc-2"
|
||
|
.\" Please adjust this date whenever revising the manpage.
|
||
|
.\"
|
||
|
.SH NAME
|
||
|
procps_pids_select \- Harvest process information that matches PID or UID
|
||
|
.SH SYNOPSIS
|
||
|
.B #include <proc/procps.h>
|
||
|
.sp
|
||
|
.BI "struct pids_fetch * procps_pids_select(struct pids_info *" info ", unsigned *" these ", int "numthese ", enum pids_select_type " which ");"
|
||
|
.sp
|
||
|
Link with \fI\-lprocps\fP.
|
||
|
|
||
|
.SH DESCRIPTION
|
||
|
\fBprocps_pids_select()\fR provides the same functionality as
|
||
|
\fBprocps_pids_reap()\fR except it will only fetch information for the
|
||
|
processes that have the process ID (PID) or User ID (UID) found in the
|
||
|
array \fIthese\fR.
|
||
|
|
||
|
\fIthese\fR is an array of process IDs (PIDs) or User IDs that the
|
||
|
function will use to match against.
|
||
|
|
||
|
\fInumthese\fR the length of the \fIthese\fR array.
|
||
|
|
||
|
The \fIwhich\fR parameter tells the funtion what type of information is
|
||
|
contained in \fIthese\fR and can be either \fBPIDS_SELECT_PID\fR if
|
||
|
\fIthese\fR is an array of PIDs or \fBPIDS_SELECT_UID\fR if \fIthese\fR
|
||
|
is an array of UIDs.
|
||
|
|
||
|
The info structure first needs to be initialised by
|
||
|
.BR procps_pids_new (3).
|
||
|
if \fBprocps_pids_select()\fR returns successfully, a program can
|
||
|
then iterate through a loop using the accessor methods described in
|
||
|
.BR libproc (3).
|
||
|
|
||
|
.SH RETURN VALUE
|
||
|
\fBprocps_pids_select()\fR returns a pointer to struct pids_fetch
|
||
|
on success and NULL on failure.
|
||
|
|
||
|
.SH VERSIONS
|
||
|
\fBprocps_pids_select()\fR first appeared in libproc-2 version 0.0.
|
||
|
|
||
|
.SH SEE ALSO
|
||
|
.BR libproc (3),
|
||
|
.BR procps_pids_new (3),
|
||
|
.BR procps_pids_reap (3),
|
||
|
.BR procps_pids_unref (3),
|
||
|
.BR proc (5).
|