xref: /illumos-gate/usr/src/man/man3proc/Psignal.3proc (revision ab618543cc6fc4bc273c077ef5d247961cdb29d4)
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 PSIGNAL 3PROC
1643051d27SRobert Mustacchi.Os
1743051d27SRobert Mustacchi.Sh NAME
1843051d27SRobert Mustacchi.Nm Psignal
1943051d27SRobert Mustacchi.Nd set signal tracing action
20*ab618543SJohn Levon.Sh LIBRARY
2143051d27SRobert Mustacchi.Lb libproc
22*ab618543SJohn Levon.Sh SYNOPSIS
2343051d27SRobert Mustacchi.In libproc.h
2443051d27SRobert Mustacchi.Ft int
2543051d27SRobert Mustacchi.Fo Psignal
2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
2743051d27SRobert Mustacchi.Fa "int which"
2843051d27SRobert Mustacchi.Fa "int stop"
2943051d27SRobert Mustacchi.Fc
3043051d27SRobert Mustacchi.Sh DESCRIPTION
3143051d27SRobert MustacchiThe
3243051d27SRobert Mustacchi.Fn Psignal
3343051d27SRobert Mustacchifunction sets the signal tracing flag for the process handle
3443051d27SRobert Mustacchi.Fa P .
3543051d27SRobert MustacchiIf
3643051d27SRobert Mustacchi.Fa stop
3743051d27SRobert Mustacchiis
3843051d27SRobert Mustacchi.Sy non-zero
3943051d27SRobert Mustacchiit causes the process handle to stop threads that encounter the signal
4043051d27SRobert Mustacchi.Fa which .
4143051d27SRobert MustacchiIf
4243051d27SRobert Mustacchi.Fa stop
4343051d27SRobert Mustacchiis
4443051d27SRobert Mustacchi.Sy zero ,
4543051d27SRobert Mustacchithen it disables tracing for the signal
4643051d27SRobert Mustacchi.Fa which .
4743051d27SRobert Mustacchi.Pp
4843051d27SRobert MustacchiThe signal constants, representing valid values for
4943051d27SRobert Mustacchi.Fa which ,
5043051d27SRobert Mustacchican be found in
5143051d27SRobert Mustacchi.Xr signal.h 3HEAD.
5243051d27SRobert MustacchiThe signal
5343051d27SRobert Mustacchi.Dv SIGKILL
5443051d27SRobert Mustacchimay not be stopped.
5543051d27SRobert Mustacchi.Pp
5643051d27SRobert MustacchiNote, only active processes may have their signal tracing flags updated.
5743051d27SRobert MustacchiProcess handles that refer to core files, zombie processes, and files do
5872d3dbb9SYuri Pankovnot have signal tracing flags.
5972d3dbb9SYuri PankovCalling this function on them is an error.
6043051d27SRobert Mustacchi.Sh RETURN VALUES
6143051d27SRobert MustacchiUpon successful completion, the
6243051d27SRobert Mustacchi.Fn Psignal
6343051d27SRobert Mustacchifunction returns the previous disposition of the signal
6443051d27SRobert Mustacchi.Fa which .
6543051d27SRobert MustacchiIt returns
6643051d27SRobert Mustacchi.Sy 1
6743051d27SRobert Mustacchiif it was set and
6843051d27SRobert Mustacchi.Sy 0
6972d3dbb9SYuri Pankovif not.
7072d3dbb9SYuri PankovOtherwise,
7143051d27SRobert Mustacchi.Sy -1
7243051d27SRobert Mustacchiis returned and
7343051d27SRobert Mustacchi.Sy errno
7443051d27SRobert Mustacchiis set to indicate the error.
7543051d27SRobert Mustacchi.Sh ERRORS
7643051d27SRobert MustacchiThe
7743051d27SRobert Mustacchi.Fn Psignal
7843051d27SRobert Mustacchifunction will fail if:
7943051d27SRobert Mustacchi.Bl -tag -width Er
8043051d27SRobert Mustacchi.It Er EINVAL
8143051d27SRobert Mustacchi.Fa which
8243051d27SRobert Mustacchiis
8343051d27SRobert Mustacchi.Dv SIGKILL
8443051d27SRobert Mustacchiand
8543051d27SRobert Mustacchi.Fa stop
8643051d27SRobert Mustacchiis non-zero .
8743051d27SRobert Mustacchi.Pp
8843051d27SRobert Mustacchi.Fa which
8943051d27SRobert Mustacchiis not a valid signal.
9043051d27SRobert Mustacchi.It Er ENOENT
9143051d27SRobert Mustacchi.Fa P
9243051d27SRobert Mustacchidoes not correspond to an active process.
9343051d27SRobert Mustacchi.El
9443051d27SRobert Mustacchi.Sh INTERFACE STABILITY
9543051d27SRobert Mustacchi.Sy Uncommitted
9643051d27SRobert Mustacchi.Sh MT-LEVEL
9743051d27SRobert MustacchiSee
9843051d27SRobert Mustacchi.Sy LOCKING
9943051d27SRobert Mustacchiin
10043051d27SRobert Mustacchi.Xr libproc 3LIB .
10143051d27SRobert Mustacchi.Sh SEE ALSO
10243051d27SRobert Mustacchi.Xr signal.h 3HEAD ,
10343051d27SRobert Mustacchi.Xr libproc 3LIB ,
10443051d27SRobert Mustacchi.Xr Psetsignal 3PROC ,
10543051d27SRobert Mustacchi.Xr proc 4
106