-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBSD-Handler.html
More file actions
128 lines (111 loc) · 5.95 KB
/
BSD-Handler.html
File metadata and controls
128 lines (111 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<html lang="en">
<head>
<title>BSD Handler - The GNU C Library</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The GNU C Library">
<meta name="generator" content="makeinfo 4.9">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="BSD-Signal-Handling.html#BSD-Signal-Handling" title="BSD Signal Handling">
<link rel="next" href="Blocking-in-BSD.html#Blocking-in-BSD" title="Blocking in BSD">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU C library.
This is Edition 0.11, last updated 2007-09-09,
of `The GNU C Library Reference Manual', for version 2.7.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
2003, 2007 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software Needs Free Documentation''
and ``GNU Lesser General Public License'', the Front-Cover texts being
``A GNU Manual'', and with the Back-Cover Texts as in (a) below. A
copy of the license is included in the section entitled "GNU Free
Documentation License".
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="BSD-Handler"></a>
Next: <a rel="next" accesskey="n" href="Blocking-in-BSD.html#Blocking-in-BSD">Blocking in BSD</a>,
Up: <a rel="up" accesskey="u" href="BSD-Signal-Handling.html#BSD-Signal-Handling">BSD Signal Handling</a>
<hr>
</div>
<h4 class="subsection">24.10.1 BSD Function to Establish a Handler</h4>
<!-- signal.h -->
<!-- BSD -->
<div class="defun">
— Data Type: <b>struct sigvec</b><var><a name="index-struct-sigvec-2991"></a></var><br>
<blockquote><p>This data type is the BSD equivalent of <code>struct sigaction</code>
(see <a href="Advanced-Signal-Handling.html#Advanced-Signal-Handling">Advanced Signal Handling</a>); it is used to specify signal actions
to the <code>sigvec</code> function. It contains the following members:
<dl>
<dt><code>sighandler_t sv_handler</code><dd>This is the handler function.
<br><dt><code>int sv_mask</code><dd>This is the mask of additional signals to be blocked while the handler
function is being called.
<br><dt><code>int sv_flags</code><dd>This is a bit mask used to specify various flags which affect the
behavior of the signal. You can also refer to this field as
<code>sv_onstack</code>.
</dl>
</p></blockquote></div>
<p>These symbolic constants can be used to provide values for the
<code>sv_flags</code> field of a <code>sigvec</code> structure. This field is a bit
mask value, so you bitwise-OR the flags of interest to you together.
<!-- signal.h -->
<!-- BSD -->
<div class="defun">
— Macro: int <b>SV_ONSTACK</b><var><a name="index-SV_005fONSTACK-2992"></a></var><br>
<blockquote><p>If this bit is set in the <code>sv_flags</code> field of a <code>sigvec</code>
structure, it means to use the signal stack when delivering the signal.
</p></blockquote></div>
<!-- signal.h -->
<!-- BSD -->
<div class="defun">
— Macro: int <b>SV_INTERRUPT</b><var><a name="index-SV_005fINTERRUPT-2993"></a></var><br>
<blockquote><p>If this bit is set in the <code>sv_flags</code> field of a <code>sigvec</code>
structure, it means that system calls interrupted by this kind of signal
should not be restarted if the handler returns; instead, the system
calls should return with a <code>EINTR</code> error status. See <a href="Interrupted-Primitives.html#Interrupted-Primitives">Interrupted Primitives</a>.
</p></blockquote></div>
<!-- signal.h -->
<!-- Sun -->
<div class="defun">
— Macro: int <b>SV_RESETHAND</b><var><a name="index-SV_005fRESETHAND-2994"></a></var><br>
<blockquote><p>If this bit is set in the <code>sv_flags</code> field of a <code>sigvec</code>
structure, it means to reset the action for the signal back to
<code>SIG_DFL</code> when the signal is received.
</p></blockquote></div>
<!-- signal.h -->
<!-- BSD -->
<div class="defun">
— Function: int <b>sigvec</b> (<var>int signum, const struct sigvec *action,struct sigvec *old-action</var>)<var><a name="index-sigvec-2995"></a></var><br>
<blockquote><p>This function is the equivalent of <code>sigaction</code> (see <a href="Advanced-Signal-Handling.html#Advanced-Signal-Handling">Advanced Signal Handling</a>); it installs the action <var>action</var> for the signal <var>signum</var>,
returning information about the previous action in effect for that signal
in <var>old-action</var>.
</p></blockquote></div>
<!-- signal.h -->
<!-- BSD -->
<div class="defun">
— Function: int <b>siginterrupt</b> (<var>int signum, int failflag</var>)<var><a name="index-siginterrupt-2996"></a></var><br>
<blockquote><p>This function specifies which approach to use when certain primitives
are interrupted by handling signal <var>signum</var>. If <var>failflag</var> is
false, signal <var>signum</var> restarts primitives. If <var>failflag</var> is
true, handling <var>signum</var> causes these primitives to fail with error
code <code>EINTR</code>. See <a href="Interrupted-Primitives.html#Interrupted-Primitives">Interrupted Primitives</a>.
</p></blockquote></div>
</body></html>