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 PCLEARSIG 3PROC
  16 .Os
  17 .Sh NAME
  18 .Nm Pclearsig ,
  19 .Nm Lclearsig
  20 .Nd clear process signals
  21 .Sh SYNOPSIS
  22 .Lb libproc
  23 .In libproc.h
  24 .Ft int
  25 .Fo Pclearsig
  26 .Fa "struct ps_prochandle *P"
  27 .Fc
  28 .Ft int
  29 .Fo Lclearsig
  30 .Fa "struct ps_lwphandle *L"
  31 .Fc
  32 .Sh DESCRIPTION
  33 During normal operation a process may receive a signal.
  34 Signals may indicate an error, for example referencing unmapped memory, an alarm
  35 firing, requests for information, and users requesting an interruption.
  36 For more information on the generation and usage of signals, see
  37 .Xr signal.h 3HEAD .
  38 .Pp
  39 The
  40 .Fn Pclearsig
  41 function instructs the system to clear any signal pending delivery to
  42 a thread in the process represented by the process handle
  43 .Fa P .
  44 The pending signal will never be delivered to process represented by
  45 .Fa P .
  46 .Pp
  47 The
  48 .Fn Lclearsig
  49 function is identical to the
  50 .Fn Pclearsig
  51 function, except rather than operating on the process and its
  52 representive thread, it instead operates on the thread handle
  53 .Fa L .
  54 .Pp
  55 The
  56 .Fn Pclearsig
  57 function only has meaning for active processes.
  58 It will fail on process handles corresponding to core files, zombie processes
  59 and ELF objects.
  60 .Sh RETURN VALUES
  61 Upon successful completion, the
  62 .Fn Pclearsig
  63 function clears pending faults and
  64 returns
  65 .Sy 0 .
  66 Otherwise,
  67 .Sy -1
  68 is returned,
  69 .Sy errno
  70 is set to indicate the error,
  71 and no faults are cleared.
  72 .Sh ERRORS
  73 For a full list of possible errors see the
  74 .Sy DIAGNOSTICS
  75 section in
  76 .Xr proc 4 .
  77 .Sh INTERFACE STABILITY
  78 .Sy Uncommitted
  79 .Sh MT-LEVEL
  80 See
  81 .Sy LOCKING
  82 in
  83 .Xr libproc 3LIB .
  84 .Sh SEE ALSO
  85 .Xr signal.h 3HEAD ,
  86 .Xr libproc 3LIB ,
  87 .Xr proc 4