xref: /illumos-gate/usr/src/man/man3proc/pr_access.3proc (revision c6596baec58ade84b0609c78e64fc3f89447c7d1)
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_ACCESS 3PROC
16.Os
17.Sh NAME
18.Nm pr_access
19.Nd inject access system call into victim process
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc.h
23.Ft int
24.Fo pr_access
25.Fa "struct ps_prochandle *P"
26.Fa "const char *path"
27.Fa "int amode"
28.Fc
29.Sh DESCRIPTION
30The
31.Fn pr_access
32function injects the
33.Xr access 2
34system call into the target process
35.Fa P
36by means of the agent lwp. If the process handle
37.Fa P
38is
39.Dv NULL
40then this is equivalent to calling
41.Xr access 2
42on the currently running process.
43.Pp
44The arguments
45.Fa path
46and
47.Fa amode
48have the same meaning as in
49.Xr access 2 .
50See
51.Xr access 2
52for the full description and purpose of the
53.Sy access
54system call and its arguments.
55.Pp
56The
57.Fn pr_access
58function only works on active processes. Process handles that correspond
59to core files, zombie processes, or ELF objects do not support system
60call injection.
61.Sh RETURN VALUES
62Upon successful completion, the
63.Fn pr_access
64function's return value is that described in
65.Xr access 2 .
66Otherwise,
67.Sy -1
68is returned and
69.Sy errno
70is set to
71.Er ENOSYS
72to indicate that the system call could not be injected.
73.Sh ERRORS
74For the full list of errors see the
75.Sy ERRORS
76section in
77.Xr access 2 .
78.Pp
79The
80.Fn pr_access
81function will fail if:
82.Bl -tag -width Er
83.It Er ENOSYS
84An error occurred while trying to invoke the agent LWP and inject a
85system call in the process handle
86.Fa P
87or the process handle
88.Fa P
89does not support system call injection.
90.El
91.Sh INTERFACE STABILITY
92.Sy Uncommitted
93.Sh MT-LEVEL
94See
95.Sy LOCKING
96in
97.Xr libproc 3LIB .
98.Sh SEE ALSO
99.Xr access 2 ,
100.Xr libproc 3LIB ,
101.Xr proc 4
102