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