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