Tue Dec 27 02:20:46 2016 UTC ()
Replace in comment SIGPOLL with SIGIO

SIGPOLL is absent in NetBSD.

No functional change.


(kamil)
diff -r1.25 -r1.26 src/sys/sys/siginfo.h

cvs diff -r1.25 -r1.26 src/sys/sys/siginfo.h (switch to unified diff)

--- src/sys/sys/siginfo.h 2013/11/22 21:04:11 1.25
+++ src/sys/sys/siginfo.h 2016/12/27 02:20:46 1.26
@@ -1,247 +1,247 @@ @@ -1,247 +1,247 @@
1/* $NetBSD: siginfo.h,v 1.25 2013/11/22 21:04:11 christos Exp $ */ 1/* $NetBSD: siginfo.h,v 1.26 2016/12/27 02:20:46 kamil Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas. 8 * by Christos Zoulas.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _SYS_SIGINFO_H_ 32#ifndef _SYS_SIGINFO_H_
33#define _SYS_SIGINFO_H_ 33#define _SYS_SIGINFO_H_
34 34
35#include <machine/signal.h> 35#include <machine/signal.h>
36#include <sys/featuretest.h> 36#include <sys/featuretest.h>
37#ifdef _KERNEL 37#ifdef _KERNEL
38#include <sys/queue.h> 38#include <sys/queue.h>
39#endif 39#endif
40 40
41typedef union sigval { 41typedef union sigval {
42 int sival_int; 42 int sival_int;
43 void *sival_ptr; 43 void *sival_ptr;
44} sigval_t; 44} sigval_t;
45 45
46struct _ksiginfo { 46struct _ksiginfo {
47 int _signo; 47 int _signo;
48 int _code; 48 int _code;
49 int _errno; 49 int _errno;
50#ifdef _LP64 50#ifdef _LP64
51 /* In _LP64 the union starts on an 8-byte boundary. */ 51 /* In _LP64 the union starts on an 8-byte boundary. */
52 int _pad; 52 int _pad;
53#endif 53#endif
54 union { 54 union {
55 struct { 55 struct {
56 pid_t _pid; 56 pid_t _pid;
57 uid_t _uid; 57 uid_t _uid;
58 sigval_t _value; 58 sigval_t _value;
59 } _rt; 59 } _rt;
60 60
61 struct { 61 struct {
62 pid_t _pid; 62 pid_t _pid;
63 uid_t _uid; 63 uid_t _uid;
64 int _status; 64 int _status;
65 clock_t _utime; 65 clock_t _utime;
66 clock_t _stime; 66 clock_t _stime;
67 } _child; 67 } _child;
68 68
69 struct { 69 struct {
70 void *_addr; 70 void *_addr;
71 int _trap; 71 int _trap;
72 int _trap2; 72 int _trap2;
73 int _trap3; 73 int _trap3;
74 } _fault; 74 } _fault;
75 75
76 struct { 76 struct {
77 long _band; 77 long _band;
78 int _fd; 78 int _fd;
79 } _poll; 79 } _poll;
80 } _reason; 80 } _reason;
81}; 81};
82 82
83#ifdef _KERNEL 83#ifdef _KERNEL
84typedef struct ksiginfo { 84typedef struct ksiginfo {
85 u_long ksi_flags; /* 4 or 8 bytes (LP64) */ 85 u_long ksi_flags; /* 4 or 8 bytes (LP64) */
86 TAILQ_ENTRY(ksiginfo) ksi_list; 86 TAILQ_ENTRY(ksiginfo) ksi_list;
87 struct _ksiginfo ksi_info; 87 struct _ksiginfo ksi_info;
88 lwpid_t ksi_lid; /* 0, or directed to LWP */ 88 lwpid_t ksi_lid; /* 0, or directed to LWP */
89} ksiginfo_t; 89} ksiginfo_t;
90 90
91#define KSI_TRAP 0x01 /* signal caused by trap */ 91#define KSI_TRAP 0x01 /* signal caused by trap */
92#define KSI_EMPTY 0x02 /* no additional information */ 92#define KSI_EMPTY 0x02 /* no additional information */
93#define KSI_QUEUED 0x04 /* on a sigpend_t queue */ 93#define KSI_QUEUED 0x04 /* on a sigpend_t queue */
94#define KSI_FROMPOOL 0x08 /* allocated from the ksiginfo pool */ 94#define KSI_FROMPOOL 0x08 /* allocated from the ksiginfo pool */
95 95
96/* Macros to initialize a ksiginfo_t. */ 96/* Macros to initialize a ksiginfo_t. */
97#define KSI_INIT(ksi) \ 97#define KSI_INIT(ksi) \
98do { \ 98do { \
99 memset((ksi), 0, sizeof(*(ksi))); \ 99 memset((ksi), 0, sizeof(*(ksi))); \
100} while (/*CONSTCOND*/0) 100} while (/*CONSTCOND*/0)
101 101
102#define KSI_INIT_EMPTY(ksi) \ 102#define KSI_INIT_EMPTY(ksi) \
103do { \ 103do { \
104 KSI_INIT((ksi)); \ 104 KSI_INIT((ksi)); \
105 (ksi)->ksi_flags = KSI_EMPTY; \ 105 (ksi)->ksi_flags = KSI_EMPTY; \
106} while (/*CONSTCOND*/0) 106} while (/*CONSTCOND*/0)
107 107
108#define KSI_INIT_TRAP(ksi) \ 108#define KSI_INIT_TRAP(ksi) \
109do { \ 109do { \
110 KSI_INIT((ksi)); \ 110 KSI_INIT((ksi)); \
111 (ksi)->ksi_flags = KSI_TRAP; \ 111 (ksi)->ksi_flags = KSI_TRAP; \
112} while (/*CONSTCOND*/0) 112} while (/*CONSTCOND*/0)
113 113
114/* Copy the part of ksiginfo_t without the queue pointers */ 114/* Copy the part of ksiginfo_t without the queue pointers */
115#define KSI_COPY(fksi, tksi) \ 115#define KSI_COPY(fksi, tksi) \
116do { \ 116do { \
117 (tksi)->ksi_info = (fksi)->ksi_info; \ 117 (tksi)->ksi_info = (fksi)->ksi_info; \
118 (tksi)->ksi_flags = (fksi)->ksi_flags; \ 118 (tksi)->ksi_flags = (fksi)->ksi_flags; \
119} while (/*CONSTCOND*/0) 119} while (/*CONSTCOND*/0)
120 120
121 121
122/* Predicate macros to test how a ksiginfo_t was generated. */ 122/* Predicate macros to test how a ksiginfo_t was generated. */
123#define KSI_TRAP_P(ksi) (((ksi)->ksi_flags & KSI_TRAP) != 0) 123#define KSI_TRAP_P(ksi) (((ksi)->ksi_flags & KSI_TRAP) != 0)
124#define KSI_EMPTY_P(ksi) (((ksi)->ksi_flags & KSI_EMPTY) != 0) 124#define KSI_EMPTY_P(ksi) (((ksi)->ksi_flags & KSI_EMPTY) != 0)
125 125
126/* 126/*
127 * Old-style signal handler "code" arguments were only non-zero for 127 * Old-style signal handler "code" arguments were only non-zero for
128 * signals caused by traps. 128 * signals caused by traps.
129 */ 129 */
130#define KSI_TRAPCODE(ksi) (KSI_TRAP_P(ksi) ? (ksi)->ksi_trap : 0) 130#define KSI_TRAPCODE(ksi) (KSI_TRAP_P(ksi) ? (ksi)->ksi_trap : 0)
131#endif /* _KERNEL */ 131#endif /* _KERNEL */
132 132
133typedef union siginfo { 133typedef union siginfo {
134 char si_pad[128]; /* Total size; for future expansion */ 134 char si_pad[128]; /* Total size; for future expansion */
135 struct _ksiginfo _info; 135 struct _ksiginfo _info;
136} siginfo_t; 136} siginfo_t;
137 137
138/** Field access macros */ 138/** Field access macros */
139#define si_signo _info._signo 139#define si_signo _info._signo
140#define si_code _info._code 140#define si_code _info._code
141#define si_errno _info._errno 141#define si_errno _info._errno
142 142
143#define si_value _info._reason._rt._value 143#define si_value _info._reason._rt._value
144#define si_pid _info._reason._child._pid 144#define si_pid _info._reason._child._pid
145#define si_uid _info._reason._child._uid 145#define si_uid _info._reason._child._uid
146#define si_status _info._reason._child._status 146#define si_status _info._reason._child._status
147#define si_utime _info._reason._child._utime 147#define si_utime _info._reason._child._utime
148#define si_stime _info._reason._child._stime 148#define si_stime _info._reason._child._stime
149 149
150#define si_addr _info._reason._fault._addr 150#define si_addr _info._reason._fault._addr
151#define si_trap _info._reason._fault._trap 151#define si_trap _info._reason._fault._trap
152#define si_trap2 _info._reason._fault._trap2 152#define si_trap2 _info._reason._fault._trap2
153#define si_trap3 _info._reason._fault._trap3 153#define si_trap3 _info._reason._fault._trap3
154 154
155#define si_band _info._reason._poll._band 155#define si_band _info._reason._poll._band
156#define si_fd _info._reason._poll._fd 156#define si_fd _info._reason._poll._fd
157 157
158#ifdef _KERNEL 158#ifdef _KERNEL
159/** Field access macros */ 159/** Field access macros */
160#define ksi_signo ksi_info._signo 160#define ksi_signo ksi_info._signo
161#define ksi_code ksi_info._code 161#define ksi_code ksi_info._code
162#define ksi_errno ksi_info._errno 162#define ksi_errno ksi_info._errno
163 163
164#define ksi_value ksi_info._reason._rt._value 164#define ksi_value ksi_info._reason._rt._value
165#define ksi_pid ksi_info._reason._child._pid 165#define ksi_pid ksi_info._reason._child._pid
166#define ksi_uid ksi_info._reason._child._uid 166#define ksi_uid ksi_info._reason._child._uid
167#define ksi_status ksi_info._reason._child._status 167#define ksi_status ksi_info._reason._child._status
168#define ksi_utime ksi_info._reason._child._utime 168#define ksi_utime ksi_info._reason._child._utime
169#define ksi_stime ksi_info._reason._child._stime 169#define ksi_stime ksi_info._reason._child._stime
170 170
171#define ksi_addr ksi_info._reason._fault._addr 171#define ksi_addr ksi_info._reason._fault._addr
172#define ksi_trap ksi_info._reason._fault._trap 172#define ksi_trap ksi_info._reason._fault._trap
173#define ksi_trap2 ksi_info._reason._fault._trap2 173#define ksi_trap2 ksi_info._reason._fault._trap2
174#define ksi_trap3 ksi_info._reason._fault._trap3 174#define ksi_trap3 ksi_info._reason._fault._trap3
175 175
176#define ksi_band ksi_info._reason._poll._band 176#define ksi_band ksi_info._reason._poll._band
177#define ksi_fd ksi_info._reason._poll._fd 177#define ksi_fd ksi_info._reason._poll._fd
178#endif /* _KERNEL */ 178#endif /* _KERNEL */
179 179
180/** si_code */ 180/** si_code */
181/* SIGILL */ 181/* SIGILL */
182#define ILL_ILLOPC 1 /* Illegal opcode */ 182#define ILL_ILLOPC 1 /* Illegal opcode */
183#define ILL_ILLOPN 2 /* Illegal operand */ 183#define ILL_ILLOPN 2 /* Illegal operand */
184#define ILL_ILLADR 3 /* Illegal addressing mode */ 184#define ILL_ILLADR 3 /* Illegal addressing mode */
185#define ILL_ILLTRP 4 /* Illegal trap */ 185#define ILL_ILLTRP 4 /* Illegal trap */
186#define ILL_PRVOPC 5 /* Privileged opcode */ 186#define ILL_PRVOPC 5 /* Privileged opcode */
187#define ILL_PRVREG 6 /* Privileged register */ 187#define ILL_PRVREG 6 /* Privileged register */
188#define ILL_COPROC 7 /* Coprocessor error */ 188#define ILL_COPROC 7 /* Coprocessor error */
189#define ILL_BADSTK 8 /* Internal stack error */ 189#define ILL_BADSTK 8 /* Internal stack error */
190 190
191/* SIGFPE */ 191/* SIGFPE */
192#define FPE_INTDIV 1 /* Integer divide by zero */ 192#define FPE_INTDIV 1 /* Integer divide by zero */
193#define FPE_INTOVF 2 /* Integer overflow */ 193#define FPE_INTOVF 2 /* Integer overflow */
194#define FPE_FLTDIV 3 /* Floating point divide by zero */ 194#define FPE_FLTDIV 3 /* Floating point divide by zero */
195#define FPE_FLTOVF 4 /* Floating point overflow */ 195#define FPE_FLTOVF 4 /* Floating point overflow */
196#define FPE_FLTUND 5 /* Floating point underflow */ 196#define FPE_FLTUND 5 /* Floating point underflow */
197#define FPE_FLTRES 6 /* Floating point inexact result */ 197#define FPE_FLTRES 6 /* Floating point inexact result */
198#define FPE_FLTINV 7 /* Invalid Floating point operation */ 198#define FPE_FLTINV 7 /* Invalid Floating point operation */
199#define FPE_FLTSUB 8 /* Subscript out of range */ 199#define FPE_FLTSUB 8 /* Subscript out of range */
200 200
201/* SIGSEGV */ 201/* SIGSEGV */
202#define SEGV_MAPERR 1 /* Address not mapped to object */ 202#define SEGV_MAPERR 1 /* Address not mapped to object */
203#define SEGV_ACCERR 2 /* Invalid permissions for mapped object*/ 203#define SEGV_ACCERR 2 /* Invalid permissions for mapped object*/
204 204
205/* SIGBUS */ 205/* SIGBUS */
206#define BUS_ADRALN 1 /* Invalid address alignment */ 206#define BUS_ADRALN 1 /* Invalid address alignment */
207#define BUS_ADRERR 2 /* Non-existent physical address */ 207#define BUS_ADRERR 2 /* Non-existent physical address */
208#define BUS_OBJERR 3 /* Object specific hardware error */ 208#define BUS_OBJERR 3 /* Object specific hardware error */
209 209
210/* SIGTRAP */ 210/* SIGTRAP */
211#define TRAP_BRKPT 1 /* Process breakpoint */ 211#define TRAP_BRKPT 1 /* Process breakpoint */
212#define TRAP_TRACE 2 /* Process trace trap */ 212#define TRAP_TRACE 2 /* Process trace trap */
213 213
214/* SIGCHLD */ 214/* SIGCHLD */
215#define CLD_EXITED 1 /* Child has exited */ 215#define CLD_EXITED 1 /* Child has exited */
216#define CLD_KILLED 2 /* Child has terminated abnormally but */ 216#define CLD_KILLED 2 /* Child has terminated abnormally but */
217 /* did not create a core file */ 217 /* did not create a core file */
218#define CLD_DUMPED 3 /* Child has terminated abnormally and */ 218#define CLD_DUMPED 3 /* Child has terminated abnormally and */
219 /* created a core file */ 219 /* created a core file */
220#define CLD_TRAPPED 4 /* Traced child has trapped */ 220#define CLD_TRAPPED 4 /* Traced child has trapped */
221#define CLD_STOPPED 5 /* Child has stopped */ 221#define CLD_STOPPED 5 /* Child has stopped */
222#define CLD_CONTINUED 6 /* Stopped child has continued */ 222#define CLD_CONTINUED 6 /* Stopped child has continued */
223 223
224/* SIGPOLL */ 224/* SIGIO */
225#define POLL_IN 1 /* Data input available */ 225#define POLL_IN 1 /* Data input available */
226#define POLL_OUT 2 /* Output buffers available */ 226#define POLL_OUT 2 /* Output buffers available */
227#define POLL_MSG 3 /* Input message available */ 227#define POLL_MSG 3 /* Input message available */
228#define POLL_ERR 4 /* I/O Error */ 228#define POLL_ERR 4 /* I/O Error */
229#define POLL_PRI 5 /* High priority input available */ 229#define POLL_PRI 5 /* High priority input available */
230#define POLL_HUP 6 /* Device disconnected */ 230#define POLL_HUP 6 /* Device disconnected */
231 231
232 232
233/** si_code */ 233/** si_code */
234#define SI_USER 0 /* Sent by kill(2) */ 234#define SI_USER 0 /* Sent by kill(2) */
235#define SI_QUEUE -1 /* Sent by the sigqueue(2) */ 235#define SI_QUEUE -1 /* Sent by the sigqueue(2) */
236#define SI_TIMER -2 /* Generated by expiration of a timer */ 236#define SI_TIMER -2 /* Generated by expiration of a timer */
237 /* set by timer_settime(2) */ 237 /* set by timer_settime(2) */
238#define SI_ASYNCIO -3 /* Generated by completion of an */ 238#define SI_ASYNCIO -3 /* Generated by completion of an */
239 /* asynchronous I/O signal */ 239 /* asynchronous I/O signal */
240#define SI_MESGQ -4 /* Generated by arrival of a message on */ 240#define SI_MESGQ -4 /* Generated by arrival of a message on */
241 /* an empty message queue */ 241 /* an empty message queue */
242#if defined(_KERNEL) || defined(_NETBSD_SOURCE) 242#if defined(_KERNEL) || defined(_NETBSD_SOURCE)
243#define SI_LWP -5 /* Generated by _lwp_kill(2) */ 243#define SI_LWP -5 /* Generated by _lwp_kill(2) */
244#define SI_NOINFO 32767 /* No signal specific info available */ 244#define SI_NOINFO 32767 /* No signal specific info available */
245#endif 245#endif
246 246
247#endif /* !_SYS_SIGINFO_H_ */ 247#endif /* !_SYS_SIGINFO_H_ */