xref: /illumos-gate/usr/src/man/man3proc/Psignal.3proc (revision 78801af7286cd73dbc996d470f789e75993cf15d)
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 PSIGNAL 3PROC
16.Os
17.Sh NAME
18.Nm Psignal
19.Nd set signal tracing action
20.Sh LIBRARY
21.Lb libproc
22.Sh SYNOPSIS
23.In libproc.h
24.Ft int
25.Fo Psignal
26.Fa "struct ps_prochandle *P"
27.Fa "int which"
28.Fa "int stop"
29.Fc
30.Sh DESCRIPTION
31The
32.Fn Psignal
33function sets the signal tracing flag for the process handle
34.Fa P .
35If
36.Fa stop
37is
38.Sy non-zero
39it causes the process handle to stop threads that encounter the signal
40.Fa which .
41If
42.Fa stop
43is
44.Sy zero ,
45then it disables tracing for the signal
46.Fa which .
47.Pp
48The signal constants, representing valid values for
49.Fa which ,
50can be found in
51.Xr signal.h 3HEAD .
52The signal
53.Dv SIGKILL
54may not be stopped.
55.Pp
56Note, only active processes may have their signal tracing flags updated.
57Process handles that refer to core files, zombie processes, and files do
58not have signal tracing flags.
59Calling this function on them is an error.
60.Sh RETURN VALUES
61Upon successful completion, the
62.Fn Psignal
63function returns the previous disposition of the signal
64.Fa which .
65It returns
66.Sy 1
67if it was set and
68.Sy 0
69if not.
70Otherwise,
71.Sy -1
72is returned and
73.Sy errno
74is set to indicate the error.
75.Sh ERRORS
76The
77.Fn Psignal
78function will fail if:
79.Bl -tag -width Er
80.It Er EINVAL
81.Fa which
82is
83.Dv SIGKILL
84and
85.Fa stop
86is non-zero .
87.Pp
88.Fa which
89is not a valid signal.
90.It Er ENOENT
91.Fa P
92does not correspond to an active process.
93.El
94.Sh INTERFACE STABILITY
95.Sy Uncommitted
96.Sh MT-LEVEL
97See
98.Sy LOCKING
99in
100.Xr libproc 3LIB .
101.Sh SEE ALSO
102.Xr signal.h 3HEAD ,
103.Xr libproc 3LIB ,
104.Xr Psetsignal 3PROC ,
105.Xr proc 4
106