xref: /illumos-gate/usr/src/man/man3proc/Psysentry.3proc (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
143051d27SRobert Mustacchi.\"
243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the
343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0.
443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version
543051d27SRobert Mustacchi.\" 1.0 of the CDDL.
643051d27SRobert Mustacchi.\"
743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this
843051d27SRobert Mustacchi.\" source.  A copy of the CDDL is also available via the Internet at
943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL.
1043051d27SRobert Mustacchi.\"
1143051d27SRobert Mustacchi.\"
1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc.
1343051d27SRobert Mustacchi.\"
1443051d27SRobert Mustacchi.Dd May 11, 2016
1543051d27SRobert Mustacchi.Dt PSYSENTRY 3PROC
1643051d27SRobert Mustacchi.Os
1743051d27SRobert Mustacchi.Sh NAME
1843051d27SRobert Mustacchi.Nm Psysentry ,
1943051d27SRobert Mustacchi.Nm Psysexit
2043051d27SRobert Mustacchi.Nd set system call entry and exit actions
21ab618543SJohn Levon.Sh LIBRARY
2243051d27SRobert Mustacchi.Lb libproc
23ab618543SJohn Levon.Sh SYNOPSIS
2443051d27SRobert Mustacchi.In libproc.h
2543051d27SRobert Mustacchi.Ft int
2643051d27SRobert Mustacchi.Fo Psysentry
2743051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
2843051d27SRobert Mustacchi.Fa "int which"
2943051d27SRobert Mustacchi.Fa "int stop"
3043051d27SRobert Mustacchi.Fc
3143051d27SRobert Mustacchi.Ft int
3243051d27SRobert Mustacchi.Fo Psysexit
3343051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
3443051d27SRobert Mustacchi.Fa "int which"
3543051d27SRobert Mustacchi.Fa "int stop"
3643051d27SRobert Mustacchi.Fc
3743051d27SRobert Mustacchi.Sh DESCRIPTION
3843051d27SRobert MustacchiThe
39b31ca922SChris Fraire.Fn Psysentry
4043051d27SRobert Mustacchiand
41b31ca922SChris Fraire.Fn Psysexit
4243051d27SRobert Mustacchifunctions controls what actions the process handle
4343051d27SRobert Mustacchi.Fa P
4443051d27SRobert Mustacchishould take upon executing a system call.
4543051d27SRobert Mustacchi.Pp
4643051d27SRobert MustacchiThe system allows a process to be stopped on both entry and exit of a
4772d3dbb9SYuri Pankovsystem call.
4872d3dbb9SYuri PankovFor information on the state of the process when it is stopped due to system
4972d3dbb9SYuri Pankovcall tracing, see the
5043051d27SRobert Mustacchi.Sy PCSENTRY
5143051d27SRobert Mustacchiand
5243051d27SRobert Mustacchi.Sy PCSEXIT
5343051d27SRobert Mustacchisections of
54*bbf21555SRichard Lowe.Xr proc 5 .
5543051d27SRobert Mustacchi.Pp
5643051d27SRobert MustacchiThe value of the
5743051d27SRobert Mustacchi.Fa stop
5843051d27SRobert Mustacchiparameter controls whether or not the system call listed in
5943051d27SRobert Mustacchi.Fa which
6072d3dbb9SYuri Pankovcauses the process to stop.
6172d3dbb9SYuri PankovA value of non-zero indicates the process should stop;
6272d3dbb9SYuri Pankova value of 0 indicates it should not.
6343051d27SRobert Mustacchi.Pp
6443051d27SRobert MustacchiThe value of
6543051d27SRobert Mustacchi.Fa which
6672d3dbb9SYuri Pankovindicates which system call the change applies to.
6772d3dbb9SYuri PankovA value of 0 applies to all system calls.
6872d3dbb9SYuri PankovNote, the system does not supply a stable mapping from system call names to
6972d3dbb9SYuri Pankovidentifiers.
7043051d27SRobert Mustacchi.Pp
7172d3dbb9SYuri PankovThese functions only apply to actively running processes.
7272d3dbb9SYuri PankovThey do not function on handles that refer to core files, zombie processes,
7372d3dbb9SYuri Pankovor ELF objects.
7443051d27SRobert Mustacchi.Sh RETURN VALUES
7543051d27SRobert MustacchiUpon successful completion, the
76b31ca922SChris Fraire.Fn Psysentry
7743051d27SRobert Mustacchiand
78b31ca922SChris Fraire.Fn Psysexit
7943051d27SRobert Mustacchifunctions return the previous disposition of the system call --
8043051d27SRobert Mustacchi.Sy 0
8143051d27SRobert Mustacchiif it was not set to stop and
8243051d27SRobert Mustacchi.Sy 1
8343051d27SRobert Mustacchiif it was --
8472d3dbb9SYuri Pankovand the system call state is updated.
8572d3dbb9SYuri PankovOtherwise,
8643051d27SRobert Mustacchi.Sy -1
8743051d27SRobert Mustacchiis returned,
8843051d27SRobert Mustacchi.Dv errno
8943051d27SRobert Mustacchiis updated with the error that occurred, and the system call state is
9043051d27SRobert Mustacchinot updated.
9143051d27SRobert Mustacchi.Sh ERRORS
9243051d27SRobert MustacchiThe
9343051d27SRobert Mustacchi.Fn Psysentry
9443051d27SRobert Mustacchiand
9543051d27SRobert Mustacchi.Fn Psysexit
9643051d27SRobert Mustacchifunctions will fail if:
9743051d27SRobert Mustacchi.Bl -tag -width Er
9843051d27SRobert Mustacchi.It Er EINVAL
9943051d27SRobert MustacchiThe value of
10043051d27SRobert Mustacchi.Fa which
10143051d27SRobert Mustacchiis invalid, e.g. it is less than zero or greater than the largest defined
10243051d27SRobert Mustacchisystem call.
10343051d27SRobert Mustacchi.It Er ENOENT
10443051d27SRobert MustacchiThe handle
10543051d27SRobert Mustacchi.Fa P
10643051d27SRobert Mustacchirefers to a process that is a zombie, a core file, or an ELF object.
10743051d27SRobert Mustacchi.El
10843051d27SRobert Mustacchi.Sh INTERFACE STABILITY
10943051d27SRobert Mustacchi.Sy Uncommitted
11043051d27SRobert Mustacchi.Pp
11143051d27SRobert MustacchiNote, while the
11243051d27SRobert Mustacchi.Fn Psysentry
11343051d27SRobert Mustacchiand
11443051d27SRobert Mustacchi.Fn Psysexit
11543051d27SRobert Mustacchifunctions are uncommitted, the mapping of system calls to system call
11643051d27SRobert Mustacchinumbers is
11743051d27SRobert Mustacchi.Sy Not-an-Interface
11843051d27SRobert Mustacchiand may change at any time.
11943051d27SRobert Mustacchi.Sh MT-LEVEL
12043051d27SRobert MustacchiSee
12143051d27SRobert Mustacchi.Sy LOCKING
12243051d27SRobert Mustacchiin
12343051d27SRobert Mustacchi.Xr libproc 3LIB .
12443051d27SRobert Mustacchi.Sh SEE ALSO
12543051d27SRobert Mustacchi.Xr libproc 3LIB ,
126*bbf21555SRichard Lowe.Xr proc 5 ,
127*bbf21555SRichard Lowe.Xr attributes 7
128