xref: /illumos-gate/usr/src/man/man3proc/Psysentry.3proc (revision dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2)
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 PSYSENTRY 3PROC
16.Os
17.Sh NAME
18.Nm Psysentry ,
19.Nm Psysexit
20.Nd set system call entry and exit actions
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft int
25.Fo Psysentry
26.Fa "struct ps_prochandle *P"
27.Fa "int which"
28.Fa "int stop"
29.Fc
30.Ft int
31.Fo Psysexit
32.Fa "struct ps_prochandle *P"
33.Fa "int which"
34.Fa "int stop"
35.Fc
36.Sh DESCRIPTION
37The
38.Fn Psetentry
39and
40.Fn Psetexit
41functions controls what actions the process handle
42.Fa P
43should take upon executing a system call.
44.Pp
45The system allows a process to be stopped on both entry and exit of a
46system call. For information on the state of the process when it is
47stopped due to system call tracing, see the
48.Sy PCSENTRY
49and
50.Sy PCSEXIT
51sections of
52.Xr proc 4 .
53.Pp
54The value of the
55.Fa stop
56parameter controls whether or not the system call listed in
57.Fa which
58causes the process to stop. A value of non-zero indicates the process
59should stop; a value of 0 indicates it should not.
60.Pp
61The value of
62.Fa which
63indicates which system call the change applies to. A value of 0
64applies to all system calls. Note, the system does not supply a stable
65mapping from system call names to identifiers.
66.Pp
67These functions only apply to actively running processes. They do not
68function on handles that refer to core files, zombie processes, or ELF
69objects.
70.Sh RETURN VALUES
71Upon successful completion, the
72.Fn Psetentry
73and
74.Fn Psetexit
75functions return the previous disposition of the system call --
76.Sy 0
77if it was not set to stop and
78.Sy 1
79if it was --
80and the system call state is updated. Otherwise,
81.Sy -1
82is returned,
83.Dv errno
84is updated with the error that occurred, and the system call state is
85not updated.
86.Sh ERRORS
87The
88.Fn Psysentry
89and
90.Fn Psysexit
91functions will fail if:
92.Bl -tag -width Er
93.It Er EINVAL
94The value of
95.Fa which
96is invalid, e.g. it is less than zero or greater than the largest defined
97system call.
98.It Er ENOENT
99The handle
100.Fa P
101refers to a process that is a zombie, a core file, or an ELF object.
102.El
103.Sh INTERFACE STABILITY
104.Sy Uncommitted
105.Pp
106Note, while the
107.Fn Psysentry
108and
109.Fn Psysexit
110functions are uncommitted, the mapping of system calls to system call
111numbers is
112.Sy Not-an-Interface
113and may change at any time.
114.Sh MT-LEVEL
115See
116.Sy LOCKING
117in
118.Xr libproc 3LIB .
119.Sh SEE ALSO
120.Xr libproc 3LIB ,
121.Xr Psysentry 3PROC ,
122.Xr Psysexit 3PROC ,
123.Xr proc 4 ,
124.Xr attributes 5
125