xref: /illumos-gate/usr/src/man/man3proc/Pclearfault.3proc (revision dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2)
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 PCLEARFAULT 3PROC
16.Os
17.Sh NAME
18.Nm Pclearfault ,
19.Nm Lclearfault
20.Nd clear process and thread faults
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft int
25.Fo Pclearfault
26.Fa "struct ps_prochandle *P"
27.Fc
28.Ft int
29.Fo Lclearfault
30.Fa "struct ps_lwphandle *L"
31.Fc
32.Sh DESCRIPTION
33During normal operation a process may encounter a
34.Sy fault ,
35due to a hardware exception, identifying a problem with the running
36process. Hardware faults include things like executing illegal
37instructions, encountering a breakpoint, and arithmetic exceptions.
38Faults are discussed further in
39.Xr proc 4 .
40.Pp
41The
42.Fn Pclearfault
43function instructs the system to clear any fault pending delivery to a
44thread in the process represented by the process handle
45.Fa P .
46The pending fault will never be delivered to process represented by
47.Fa P .
48.Pp
49The
50.Fn Lclearfault
51function is identical to the
52.Fn Pclearfault
53function, except rather than operating on the representative thread of
54the process it operates on the thread handle
55.Fa L .
56.Pp
57The
58.Fn Pclearfault
59and
60.Fn Lclearfault
61functions only have meaning for active processes. They will fail on process
62handles corresponding to zombie processes, ELF objects, and cores.
63.Sh RETURN VALUES
64Upon successful completion, the
65.Fn Pclearfault
66and
67.Fn Lclearfault
68functions clear pending faults and return
69.Sy 0 .
70Otherwise,
71.Sy -1
72is returned,
73.Sy errno
74is set to indicate the error,
75and no faults are cleared.
76.Sh ERRORS
77For a full list of possible errors see the
78.Sy DIAGNOSTICS
79section in
80.Xr proc 4 .
81.Sh INTERFACE STABILITY
82.Sy Uncommitted
83.Sh MT-LEVEL
84See
85.Sy LOCKING
86in
87.Xr libproc 3LIB .
88.Sh SEE ALSO
89.Xr libproc 3LIB ,
90.Xr proc 4
91