Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Pfault.3proc
+++ new/usr/src/man/man3proc/Pfault.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
14 14 .Dd May 11, 2016
15 15 .Dt PFAULT 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Pfault
19 19 .Nd enable and disable the tracing of faults
20 -.Sh SYNOPSIS
20 +.Sh LIBRARY
21 21 .Lb libproc
22 +.Sh SYNOPSIS
22 23 .In libproc.h
23 24 .Ft "int"
24 25 .Fo Pfault
25 26 .Fa "struct ps_prochandle *P"
26 27 .Fa "int which"
27 28 .Fa "int stop"
28 29 .Fc
29 30 .Sh DESCRIPTION
30 31 The
31 32 .Fn Pfault
32 33 function controls what the process
33 34 .Fa P
34 35 should do on faults.
35 36 .Pp
36 37 A fault is a hardware event that occurs in the context of a running
37 38 process and thread.
38 39 A hardware fault may occur because an illegal instruction was executed,
39 40 a breakpoint or watchpoint was encountered, or an arithmetic exception occurred,
40 41 among others.
41 42 The full list of faults is available in both
42 43 .Xr proc 4
43 44 and
44 45 .In sys/fault.h .
45 46 .Pp
46 47 For each hardware fault, a process may be configured to stop the thread
47 48 that encountered it when it occurs.
48 49 The value of the
49 50 .Fa stop
50 51 parameter controls whether or not the listed fault in
51 52 .Fa which
52 53 will cause the thread to trap.
53 54 A value of 1 indicates the thread should stop; a value of 0 indicates it should
54 55 not.
55 56 .Pp
56 57 The value of
57 58 .Fa which
58 59 indicates which hardware fault the change applies to.
59 60 However, if the value of
60 61 .Fa which
61 62 is zero, then it applies to all faults.
62 63 .Pp
63 64 The
64 65 .Fn Pfault
65 66 function only applies to actively running processes.
66 67 It does not function on handles that refer to core files, zombie processes, or
67 68 ELF objects.
68 69 .Sh RETURN VALUES
69 70 Upon successful completion, the
70 71 .Fn Pfault
71 72 function returns the old disposition of the fault --
72 73 .Sy 0
73 74 if it was not set to stop and
74 75 .Sy 1
75 76 if it was --
76 77 and the fault state is updated.
77 78 Otherwise,
78 79 .Sy -1
79 80 is returned,
80 81 .Dv errno
81 82 is updated with the error that occurred, and the fault state is not
82 83 updated.
83 84 .Sh ERRORS
84 85 The
85 86 .Fn Pfault
86 87 function will fail if:
87 88 .Bl -tag -width Er
88 89 .It Er EINVAL
89 90 The value of
90 91 .Fa which
91 92 is invalid, e.g. it is less than zero or greater than the largest defined
92 93 fault.
93 94 .It Er ENOENT
94 95 The handle
95 96 .Fa P
96 97 refers to a process that is a zombie, a core file, or a file.
97 98 .El
98 99 .Sh INTERFACE STABILITY
99 100 .Sy Uncommitted
100 101 .Sh MT-LEVEL
101 102 See
102 103 .Sy LOCKING
103 104 in
104 105 .Xr libproc 3LIB .
105 106 .Sh SEE ALSO
106 107 .Xr libproc 3LIB ,
107 108 .Xr proc 4
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX