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. 58Calling this function on them is an error. 59.Sh RETURN VALUES 60Upon successful completion, the 61.Fn Psignal 62function returns the previous disposition of the signal 63.Fa which . 64It returns 65.Sy 1 66if it was set and 67.Sy 0 68if not. 69Otherwise, 70.Sy -1 71is returned and 72.Sy errno 73is set to indicate the error. 74.Sh ERRORS 75The 76.Fn Psignal 77function will fail if: 78.Bl -tag -width Er 79.It Er EINVAL 80.Fa which 81is 82.Dv SIGKILL 83and 84.Fa stop 85is non-zero . 86.Pp 87.Fa which 88is not a valid signal. 89.It Er ENOENT 90.Fa P 91does not correspond to an active process. 92.El 93.Sh INTERFACE STABILITY 94.Sy Uncommitted 95.Sh MT-LEVEL 96See 97.Sy LOCKING 98in 99.Xr libproc 3LIB . 100.Sh SEE ALSO 101.Xr signal.h 3HEAD , 102.Xr libproc 3LIB , 103.Xr Psetsignal 3PROC , 104.Xr proc 4 105