xref: /illumos-gate/usr/src/man/man3proc/pr_meminfo.3proc (revision b7daf79982d77b491ef9662483cd4549e0e5da9a)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2015 Joyent, Inc.
13.\"
14.Dd May 11, 2016
15.Dt PR_MEMINFO 3PROC
16.Os
17.Sh NAME
18.Nm pr_meminfo
19.Nd inject meminfo system call into victim process
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc.h
23.Ft int
24.Fo pr_meminfo
25.Fa "struct ps_prochandle *P"
26.Fa "const uint64_t *addrs"
27.Fa "int addr_count"
28.Fa "const uint_t *info"
29.Fa "int info_count"
30.Fa "uint64_t *outdata"
31.Fa "uint_t *validity"
32.Fc
33.Sh DESCRIPTION
34The
35.Fn pr_meminfo
36function injects the
37.Xr meminfo 2
38system call into the target process
39.Fa P
40by means of the agent LWP.
41If the process handle
42.Fa P
43is the value
44.Dv NULL
45then this will be equivalent to calling
46.Xr meminfo 2
47on the currently running process.
48.Pp
49The arguments
50.Fa addrs ,
51.Fa addr_count ,
52.Fa info ,
53.Fa info_count ,
54.Fa outdata ,
55and
56.Fa validity
57have the same meaning as in
58.Xr meminfo 2 .
59See
60.Xr meminfo 2
61for the full description and purpose of the
62.Sy meminfo
63system call and its arguments.
64.Pp
65The
66.Fn pr_meminfo
67function only works on active processes.
68Process handles that correspond to core files, zombie processes, or ELF objects
69do not support system call injection.
70.Sh RETURN VALUES
71Upon successful completion, the
72.Fn pr_meminfo
73function's return value is that described in
74.Xr meminfo 2 .
75Otherwise,
76.Sy -1
77is returned and
78.Sy errno
79is set to
80.Er ENOSYS
81to indicate that the system call could not be injected.
82.Sh ERRORS
83For the full list of errors see the
84.Sy ERRORS
85section in
86.Xr meminfo 2 .
87.Pp
88The
89.Fn pr_meminfo
90function will fail if:
91.Bl -tag -width Er
92.It Er ENOSYS
93An error occurred while trying to invoke the agent LWP and inject a
94system call in the process handle
95.Fa P
96or the process handle
97.Fa P
98does not support system call injection.
99.El
100.Sh INTERFACE STABILITY
101.Sy Uncommitted
102.Sh MT-LEVEL
103See
104.Sy LOCKING
105in
106.Xr libproc 3LIB .
107.Sh SEE ALSO
108.Xr meminfo 2 ,
109.Xr libproc 3LIB ,
110.Xr proc 4
111