xref: /illumos-gate/usr/src/man/man3proc/Psysentry.3proc (revision 8c69cc8fbe729fa7b091e901c4b50508ccc6bb33)
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 Psysentry
39and
40.Fn Psysexit
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.
47For information on the state of the process when it is stopped due to system
48call tracing, see the
49.Sy PCSENTRY
50and
51.Sy PCSEXIT
52sections of
53.Xr proc 4 .
54.Pp
55The value of the
56.Fa stop
57parameter controls whether or not the system call listed in
58.Fa which
59causes the process to stop.
60A value of non-zero indicates the process should stop;
61a value of 0 indicates it should not.
62.Pp
63The value of
64.Fa which
65indicates which system call the change applies to.
66A value of 0 applies to all system calls.
67Note, the system does not supply a stable mapping from system call names to
68identifiers.
69.Pp
70These functions only apply to actively running processes.
71They do not function on handles that refer to core files, zombie processes,
72or ELF objects.
73.Sh RETURN VALUES
74Upon successful completion, the
75.Fn Psysentry
76and
77.Fn Psysexit
78functions return the previous disposition of the system call --
79.Sy 0
80if it was not set to stop and
81.Sy 1
82if it was --
83and the system call state is updated.
84Otherwise,
85.Sy -1
86is returned,
87.Dv errno
88is updated with the error that occurred, and the system call state is
89not updated.
90.Sh ERRORS
91The
92.Fn Psysentry
93and
94.Fn Psysexit
95functions will fail if:
96.Bl -tag -width Er
97.It Er EINVAL
98The value of
99.Fa which
100is invalid, e.g. it is less than zero or greater than the largest defined
101system call.
102.It Er ENOENT
103The handle
104.Fa P
105refers to a process that is a zombie, a core file, or an ELF object.
106.El
107.Sh INTERFACE STABILITY
108.Sy Uncommitted
109.Pp
110Note, while the
111.Fn Psysentry
112and
113.Fn Psysexit
114functions are uncommitted, the mapping of system calls to system call
115numbers is
116.Sy Not-an-Interface
117and may change at any time.
118.Sh MT-LEVEL
119See
120.Sy LOCKING
121in
122.Xr libproc 3LIB .
123.Sh SEE ALSO
124.Xr libproc 3LIB ,
125.Xr proc 4 ,
126.Xr attributes 5
127