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