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