summaryrefslogtreecommitdiff
path: root/doc/procps_pids_reset.3
blob: 7e77c26f4b54abd1f79007d347ca7701d12e9b59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" (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_reset 3 2017-01-05 "libproc-2"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
procps_pids_reset \-
Change what information is collected for a process
.SH SYNOPSIS
.B #include <proc/procps.h>
.sp
.BI "int procps_pids_reset(struct pids_info **" info ", enum pids_item *" items ", int " numitems ");"
.sp
Link with \fI\-lprocps\fP.

.SH DESCRIPTION
During the initial call to \fBprocps_pids_new\fR(3), the information structure
is allocated and the information items are specified.
\fBprocps_pids_reset\fR allows you to change what items for a process are collected
without having to unreference and create a new \fIpids_info\fR structure.

The changed  PID information structure can then be used in subsequent calls to
.BR procps_pids_get (3),
.BR procps_pids_reap (3),
.BR procps_pids_reset (3),
.BR procps_pids_select (3),
.BR procps_pids_sort (3)
or even to further calls to \fBprocps_pids_reset\fR itself.

The \fIitems\fR and \fInumitems\fR parameters are identical to the parameters
used in \fBprocps_pids_new\fR.

.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 changed structure.

.SH VERSIONS
.B procps_pids_reset()
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_select (3),
.BR procps_pids_sort (3),
.BR procps_pids_unref (3),
.BR proc (5).