2017-01-05 04:14:04 +05:30
|
|
|
.\" (C) Copyright 2016-2017 Craig Small <csmall@enc.com.au>
|
2016-04-18 18:27:01 +05:30
|
|
|
.\"
|
|
|
|
.\" %%%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
|
|
|
|
.\"
|
2017-01-05 04:14:04 +05:30
|
|
|
.TH PROCPS_PIDS_NEW 3 2017-01-05 "libproc-2"
|
2016-04-18 18:27:01 +05:30
|
|
|
.\" Please adjust this date whenever revising the manpage.
|
|
|
|
.\"
|
|
|
|
.SH NAME
|
|
|
|
procps_pids_new \-
|
|
|
|
Create a PID information structure
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <proc/procps.h>
|
|
|
|
.sp
|
2017-01-05 04:14:04 +05:30
|
|
|
.BI "int procps_pids_new(struct pids_info **" info ", enum pids_item *" items ", int " numitems ");"
|
2016-04-18 18:27:01 +05:30
|
|
|
.sp
|
|
|
|
Link with \fI\-lprocps\fP.
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.BR procps_pids_new ()
|
|
|
|
creates a new PID information structure that be used in subsequent calls to
|
2017-01-05 04:14:04 +05:30
|
|
|
.BR procps_pids_get (3),
|
|
|
|
.BR procps_pids_reap (3),
|
2016-04-18 18:27:01 +05:30
|
|
|
.BR procps_pids_reset (3),
|
2017-01-05 04:14:04 +05:30
|
|
|
.BR procps_pids_select (3),
|
2016-04-18 18:27:01 +05:30
|
|
|
.BR procps_pids_sort (3).
|
|
|
|
functions. The pointer to \fIinfo\fR will have memory allocated and a structure
|
|
|
|
created.
|
|
|
|
|
2017-01-05 04:14:04 +05:30
|
|
|
\fIitems\fR is an array of enums up to \fInumitems\fR long that selects what
|
|
|
|
information about the processed will be stored. \fInumitems\fR is used to
|
2016-04-18 18:27:01 +05:30
|
|
|
allocate memory and must be at least the length of \fIitems\fR but can be more.
|
|
|
|
For information about what \fIitems\fR can contain, see the \fBPID ITEMS\fR
|
|
|
|
section in
|
|
|
|
.BR libproc (3).
|
|
|
|
|
|
|
|
Once the structure is no longer required,
|
|
|
|
.BR procps_pids_unref (3)
|
|
|
|
should be used to free it.
|
|
|
|
|
|
|
|
.SH RETURN VALUE
|
|
|
|
The function returns 0 on success and one of negative values below
|
|
|
|
on failure.
|
|
|
|
.TP
|
|
|
|
.B -EINVAL
|
|
|
|
One of the given parameters is incorrect.
|
|
|
|
.TP
|
|
|
|
.B -ENOMEM
|
|
|
|
Unable to allocate memory for the structure.
|
|
|
|
|
|
|
|
.SH VERSIONS
|
|
|
|
.B procps_pids_new()
|
|
|
|
first appeared in libproc-2 version 0.0.
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR libproc (3),
|
2017-01-05 04:14:04 +05:30
|
|
|
.BR procps_pids_reap (3),
|
2016-04-18 18:27:01 +05:30
|
|
|
.BR procps_pids_reset (3),
|
2017-01-05 04:14:04 +05:30
|
|
|
.BR procps_pids_select (3),
|
2016-04-18 18:27:01 +05:30
|
|
|
.BR procps_pids_sort (3),
|
|
|
|
.BR procps_pids_unref (3),
|
|
|
|
.BR proc (5).
|