Loading...
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
3#define _UAPI_ASM_GENERIC_SIGINFO_H
4
5#include <linux/compiler.h>
6#include <linux/types.h>
7
8typedef union sigval {
9 int sival_int;
10 void __user *sival_ptr;
11} sigval_t;
12
13#define SI_MAX_SIZE 128
14
15/*
16 * The default "si_band" type is "long", as specified by POSIX.
17 * However, some architectures want to override this to "int"
18 * for historical compatibility reasons, so we allow that.
19 */
20#ifndef __ARCH_SI_BAND_T
21#define __ARCH_SI_BAND_T long
22#endif
23
24#ifndef __ARCH_SI_CLOCK_T
25#define __ARCH_SI_CLOCK_T __kernel_clock_t
26#endif
27
28#ifndef __ARCH_SI_ATTRIBUTES
29#define __ARCH_SI_ATTRIBUTES
30#endif
31
32union __sifields {
33 /* kill() */
34 struct {
35 __kernel_pid_t _pid; /* sender's pid */
36 __kernel_uid32_t _uid; /* sender's uid */
37 } _kill;
38
39 /* POSIX.1b timers */
40 struct {
41 __kernel_timer_t _tid; /* timer id */
42 int _overrun; /* overrun count */
43 sigval_t _sigval; /* same as below */
44 int _sys_private; /* not to be passed to user */
45 } _timer;
46
47 /* POSIX.1b signals */
48 struct {
49 __kernel_pid_t _pid; /* sender's pid */
50 __kernel_uid32_t _uid; /* sender's uid */
51 sigval_t _sigval;
52 } _rt;
53
54 /* SIGCHLD */
55 struct {
56 __kernel_pid_t _pid; /* which child */
57 __kernel_uid32_t _uid; /* sender's uid */
58 int _status; /* exit code */
59 __ARCH_SI_CLOCK_T _utime;
60 __ARCH_SI_CLOCK_T _stime;
61 } _sigchld;
62
63 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
64 struct {
65 void __user *_addr; /* faulting insn/memory ref. */
66#ifdef __ARCH_SI_TRAPNO
67 int _trapno; /* TRAP # which caused the signal */
68#endif
69#ifdef __ia64__
70 int _imm; /* immediate value for "break" */
71 unsigned int _flags; /* see ia64 si_flags */
72 unsigned long _isr; /* isr */
73#endif
74
75#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
76 sizeof(short) : __alignof__(void *))
77 union {
78 /*
79 * used when si_code=BUS_MCEERR_AR or
80 * used when si_code=BUS_MCEERR_AO
81 */
82 short _addr_lsb; /* LSB of the reported address */
83 /* used when si_code=SEGV_BNDERR */
84 struct {
85 char _dummy_bnd[__ADDR_BND_PKEY_PAD];
86 void __user *_lower;
87 void __user *_upper;
88 } _addr_bnd;
89 /* used when si_code=SEGV_PKUERR */
90 struct {
91 char _dummy_pkey[__ADDR_BND_PKEY_PAD];
92 __u32 _pkey;
93 } _addr_pkey;
94 };
95 } _sigfault;
96
97 /* SIGPOLL */
98 struct {
99 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
100 int _fd;
101 } _sigpoll;
102
103 /* SIGSYS */
104 struct {
105 void __user *_call_addr; /* calling user insn */
106 int _syscall; /* triggering system call number */
107 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
108 } _sigsys;
109};
110
111#ifndef __ARCH_HAS_SWAPPED_SIGINFO
112#define __SIGINFO \
113struct { \
114 int si_signo; \
115 int si_errno; \
116 int si_code; \
117 union __sifields _sifields; \
118}
119#else
120#define __SIGINFO \
121struct { \
122 int si_signo; \
123 int si_code; \
124 int si_errno; \
125 union __sifields _sifields; \
126}
127#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
128
129typedef struct siginfo {
130 union {
131 __SIGINFO;
132 int _si_pad[SI_MAX_SIZE/sizeof(int)];
133 };
134} __ARCH_SI_ATTRIBUTES siginfo_t;
135
136/*
137 * How these fields are to be accessed.
138 */
139#define si_pid _sifields._kill._pid
140#define si_uid _sifields._kill._uid
141#define si_tid _sifields._timer._tid
142#define si_overrun _sifields._timer._overrun
143#define si_sys_private _sifields._timer._sys_private
144#define si_status _sifields._sigchld._status
145#define si_utime _sifields._sigchld._utime
146#define si_stime _sifields._sigchld._stime
147#define si_value _sifields._rt._sigval
148#define si_int _sifields._rt._sigval.sival_int
149#define si_ptr _sifields._rt._sigval.sival_ptr
150#define si_addr _sifields._sigfault._addr
151#ifdef __ARCH_SI_TRAPNO
152#define si_trapno _sifields._sigfault._trapno
153#endif
154#define si_addr_lsb _sifields._sigfault._addr_lsb
155#define si_lower _sifields._sigfault._addr_bnd._lower
156#define si_upper _sifields._sigfault._addr_bnd._upper
157#define si_pkey _sifields._sigfault._addr_pkey._pkey
158#define si_band _sifields._sigpoll._band
159#define si_fd _sifields._sigpoll._fd
160#define si_call_addr _sifields._sigsys._call_addr
161#define si_syscall _sifields._sigsys._syscall
162#define si_arch _sifields._sigsys._arch
163
164/*
165 * si_code values
166 * Digital reserves positive values for kernel-generated signals.
167 */
168#define SI_USER 0 /* sent by kill, sigsend, raise */
169#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
170#define SI_QUEUE -1 /* sent by sigqueue */
171#define SI_TIMER -2 /* sent by timer expiration */
172#define SI_MESGQ -3 /* sent by real time mesq state change */
173#define SI_ASYNCIO -4 /* sent by AIO completion */
174#define SI_SIGIO -5 /* sent by queued SIGIO */
175#define SI_TKILL -6 /* sent by tkill system call */
176#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */
177#define SI_ASYNCNL -60 /* sent by glibc async name lookup completion */
178
179#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
180#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
181
182/*
183 * SIGILL si_codes
184 */
185#define ILL_ILLOPC 1 /* illegal opcode */
186#define ILL_ILLOPN 2 /* illegal operand */
187#define ILL_ILLADR 3 /* illegal addressing mode */
188#define ILL_ILLTRP 4 /* illegal trap */
189#define ILL_PRVOPC 5 /* privileged opcode */
190#define ILL_PRVREG 6 /* privileged register */
191#define ILL_COPROC 7 /* coprocessor error */
192#define ILL_BADSTK 8 /* internal stack error */
193#define ILL_BADIADDR 9 /* unimplemented instruction address */
194#define __ILL_BREAK 10 /* illegal break */
195#define __ILL_BNDMOD 11 /* bundle-update (modification) in progress */
196#define NSIGILL 11
197
198/*
199 * SIGFPE si_codes
200 */
201#define FPE_INTDIV 1 /* integer divide by zero */
202#define FPE_INTOVF 2 /* integer overflow */
203#define FPE_FLTDIV 3 /* floating point divide by zero */
204#define FPE_FLTOVF 4 /* floating point overflow */
205#define FPE_FLTUND 5 /* floating point underflow */
206#define FPE_FLTRES 6 /* floating point inexact result */
207#define FPE_FLTINV 7 /* floating point invalid operation */
208#define FPE_FLTSUB 8 /* subscript out of range */
209#define __FPE_DECOVF 9 /* decimal overflow */
210#define __FPE_DECDIV 10 /* decimal division by zero */
211#define __FPE_DECERR 11 /* packed decimal error */
212#define __FPE_INVASC 12 /* invalid ASCII digit */
213#define __FPE_INVDEC 13 /* invalid decimal digit */
214#define FPE_FLTUNK 14 /* undiagnosed floating-point exception */
215#define FPE_CONDTRAP 15 /* trap on condition */
216#define NSIGFPE 15
217
218/*
219 * SIGSEGV si_codes
220 */
221#define SEGV_MAPERR 1 /* address not mapped to object */
222#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
223#define SEGV_BNDERR 3 /* failed address bound checks */
224#ifdef __ia64__
225# define __SEGV_PSTKOVF 4 /* paragraph stack overflow */
226#else
227# define SEGV_PKUERR 4 /* failed protection key checks */
228#endif
229#define SEGV_ACCADI 5 /* ADI not enabled for mapped object */
230#define SEGV_ADIDERR 6 /* Disrupting MCD error */
231#define SEGV_ADIPERR 7 /* Precise MCD exception */
232#define NSIGSEGV 7
233
234/*
235 * SIGBUS si_codes
236 */
237#define BUS_ADRALN 1 /* invalid address alignment */
238#define BUS_ADRERR 2 /* non-existent physical address */
239#define BUS_OBJERR 3 /* object specific hardware error */
240/* hardware memory error consumed on a machine check: action required */
241#define BUS_MCEERR_AR 4
242/* hardware memory error detected in process but not consumed: action optional*/
243#define BUS_MCEERR_AO 5
244#define NSIGBUS 5
245
246/*
247 * SIGTRAP si_codes
248 */
249#define TRAP_BRKPT 1 /* process breakpoint */
250#define TRAP_TRACE 2 /* process trace trap */
251#define TRAP_BRANCH 3 /* process taken branch trap */
252#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */
253#define TRAP_UNK 5 /* undiagnosed trap */
254#define NSIGTRAP 5
255
256/*
257 * There is an additional set of SIGTRAP si_codes used by ptrace
258 * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
259 */
260
261/*
262 * SIGCHLD si_codes
263 */
264#define CLD_EXITED 1 /* child has exited */
265#define CLD_KILLED 2 /* child was killed */
266#define CLD_DUMPED 3 /* child terminated abnormally */
267#define CLD_TRAPPED 4 /* traced child has trapped */
268#define CLD_STOPPED 5 /* child has stopped */
269#define CLD_CONTINUED 6 /* stopped child has continued */
270#define NSIGCHLD 6
271
272/*
273 * SIGPOLL (or any other signal without signal specific si_codes) si_codes
274 */
275#define POLL_IN 1 /* data input available */
276#define POLL_OUT 2 /* output buffers available */
277#define POLL_MSG 3 /* input message available */
278#define POLL_ERR 4 /* i/o error */
279#define POLL_PRI 5 /* high priority input available */
280#define POLL_HUP 6 /* device disconnected */
281#define NSIGPOLL 6
282
283/*
284 * SIGSYS si_codes
285 */
286#define SYS_SECCOMP 1 /* seccomp triggered */
287#define NSIGSYS 1
288
289/*
290 * SIGEMT si_codes
291 */
292#define EMT_TAGOVF 1 /* tag overflow */
293#define NSIGEMT 1
294
295/*
296 * sigevent definitions
297 *
298 * It seems likely that SIGEV_THREAD will have to be handled from
299 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
300 * thread manager then catches and does the appropriate nonsense.
301 * However, everything is written out here so as to not get lost.
302 */
303#define SIGEV_SIGNAL 0 /* notify via signal */
304#define SIGEV_NONE 1 /* other notification: meaningless */
305#define SIGEV_THREAD 2 /* deliver via thread creation */
306#define SIGEV_THREAD_ID 4 /* deliver to thread */
307
308/*
309 * This works because the alignment is ok on all current architectures
310 * but we leave open this being overridden in the future
311 */
312#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
313#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
314#endif
315
316#define SIGEV_MAX_SIZE 64
317#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
318 / sizeof(int))
319
320typedef struct sigevent {
321 sigval_t sigev_value;
322 int sigev_signo;
323 int sigev_notify;
324 union {
325 int _pad[SIGEV_PAD_SIZE];
326 int _tid;
327
328 struct {
329 void (*_function)(sigval_t);
330 void *_attribute; /* really pthread_attr_t */
331 } _sigev_thread;
332 } _sigev_un;
333} sigevent_t;
334
335#define sigev_notify_function _sigev_un._sigev_thread._function
336#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
337#define sigev_notify_thread_id _sigev_un._tid
338
339
340#endif /* _UAPI_ASM_GENERIC_SIGINFO_H */
1#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
2#define _UAPI_ASM_GENERIC_SIGINFO_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6
7typedef union sigval {
8 int sival_int;
9 void __user *sival_ptr;
10} sigval_t;
11
12/*
13 * This is the size (including padding) of the part of the
14 * struct siginfo that is before the union.
15 */
16#ifndef __ARCH_SI_PREAMBLE_SIZE
17#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
18#endif
19
20#define SI_MAX_SIZE 128
21#ifndef SI_PAD_SIZE
22#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
23#endif
24
25#ifndef __ARCH_SI_UID_T
26#define __ARCH_SI_UID_T __kernel_uid32_t
27#endif
28
29/*
30 * The default "si_band" type is "long", as specified by POSIX.
31 * However, some architectures want to override this to "int"
32 * for historical compatibility reasons, so we allow that.
33 */
34#ifndef __ARCH_SI_BAND_T
35#define __ARCH_SI_BAND_T long
36#endif
37
38#ifndef __ARCH_SI_CLOCK_T
39#define __ARCH_SI_CLOCK_T __kernel_clock_t
40#endif
41
42#ifndef __ARCH_SI_ATTRIBUTES
43#define __ARCH_SI_ATTRIBUTES
44#endif
45
46#ifndef HAVE_ARCH_SIGINFO_T
47
48typedef struct siginfo {
49 int si_signo;
50 int si_errno;
51 int si_code;
52
53 union {
54 int _pad[SI_PAD_SIZE];
55
56 /* kill() */
57 struct {
58 __kernel_pid_t _pid; /* sender's pid */
59 __ARCH_SI_UID_T _uid; /* sender's uid */
60 } _kill;
61
62 /* POSIX.1b timers */
63 struct {
64 __kernel_timer_t _tid; /* timer id */
65 int _overrun; /* overrun count */
66 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
67 sigval_t _sigval; /* same as below */
68 int _sys_private; /* not to be passed to user */
69 } _timer;
70
71 /* POSIX.1b signals */
72 struct {
73 __kernel_pid_t _pid; /* sender's pid */
74 __ARCH_SI_UID_T _uid; /* sender's uid */
75 sigval_t _sigval;
76 } _rt;
77
78 /* SIGCHLD */
79 struct {
80 __kernel_pid_t _pid; /* which child */
81 __ARCH_SI_UID_T _uid; /* sender's uid */
82 int _status; /* exit code */
83 __ARCH_SI_CLOCK_T _utime;
84 __ARCH_SI_CLOCK_T _stime;
85 } _sigchld;
86
87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
88 struct {
89 void __user *_addr; /* faulting insn/memory ref. */
90#ifdef __ARCH_SI_TRAPNO
91 int _trapno; /* TRAP # which caused the signal */
92#endif
93 short _addr_lsb; /* LSB of the reported address */
94 } _sigfault;
95
96 /* SIGPOLL */
97 struct {
98 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
99 int _fd;
100 } _sigpoll;
101
102 /* SIGSYS */
103 struct {
104 void __user *_call_addr; /* calling user insn */
105 int _syscall; /* triggering system call number */
106 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
107 } _sigsys;
108 } _sifields;
109} __ARCH_SI_ATTRIBUTES siginfo_t;
110
111/* If the arch shares siginfo, then it has SIGSYS. */
112#define __ARCH_SIGSYS
113#endif
114
115/*
116 * How these fields are to be accessed.
117 */
118#define si_pid _sifields._kill._pid
119#define si_uid _sifields._kill._uid
120#define si_tid _sifields._timer._tid
121#define si_overrun _sifields._timer._overrun
122#define si_sys_private _sifields._timer._sys_private
123#define si_status _sifields._sigchld._status
124#define si_utime _sifields._sigchld._utime
125#define si_stime _sifields._sigchld._stime
126#define si_value _sifields._rt._sigval
127#define si_int _sifields._rt._sigval.sival_int
128#define si_ptr _sifields._rt._sigval.sival_ptr
129#define si_addr _sifields._sigfault._addr
130#ifdef __ARCH_SI_TRAPNO
131#define si_trapno _sifields._sigfault._trapno
132#endif
133#define si_addr_lsb _sifields._sigfault._addr_lsb
134#define si_band _sifields._sigpoll._band
135#define si_fd _sifields._sigpoll._fd
136#ifdef __ARCH_SIGSYS
137#define si_call_addr _sifields._sigsys._call_addr
138#define si_syscall _sifields._sigsys._syscall
139#define si_arch _sifields._sigsys._arch
140#endif
141
142#ifndef __KERNEL__
143#define __SI_KILL 0
144#define __SI_TIMER 0
145#define __SI_POLL 0
146#define __SI_FAULT 0
147#define __SI_CHLD 0
148#define __SI_RT 0
149#define __SI_MESGQ 0
150#define __SI_SYS 0
151#define __SI_CODE(T,N) (N)
152#endif
153
154/*
155 * si_code values
156 * Digital reserves positive values for kernel-generated signals.
157 */
158#define SI_USER 0 /* sent by kill, sigsend, raise */
159#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
160#define SI_QUEUE -1 /* sent by sigqueue */
161#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
162#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */
163#define SI_ASYNCIO -4 /* sent by AIO completion */
164#define SI_SIGIO -5 /* sent by queued SIGIO */
165#define SI_TKILL -6 /* sent by tkill system call */
166#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */
167
168#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
169#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
170
171/*
172 * SIGILL si_codes
173 */
174#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
175#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
176#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
177#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
178#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
179#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
180#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
181#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
182#define NSIGILL 8
183
184/*
185 * SIGFPE si_codes
186 */
187#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
188#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
189#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
190#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
191#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
192#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
193#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
194#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
195#define NSIGFPE 8
196
197/*
198 * SIGSEGV si_codes
199 */
200#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
201#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
202#define NSIGSEGV 2
203
204/*
205 * SIGBUS si_codes
206 */
207#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
208#define BUS_ADRERR (__SI_FAULT|2) /* non-existent physical address */
209#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
210/* hardware memory error consumed on a machine check: action required */
211#define BUS_MCEERR_AR (__SI_FAULT|4)
212/* hardware memory error detected in process but not consumed: action optional*/
213#define BUS_MCEERR_AO (__SI_FAULT|5)
214#define NSIGBUS 5
215
216/*
217 * SIGTRAP si_codes
218 */
219#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
220#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
221#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
222#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */
223#define NSIGTRAP 4
224
225/*
226 * SIGCHLD si_codes
227 */
228#define CLD_EXITED (__SI_CHLD|1) /* child has exited */
229#define CLD_KILLED (__SI_CHLD|2) /* child was killed */
230#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
231#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
232#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
233#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
234#define NSIGCHLD 6
235
236/*
237 * SIGPOLL si_codes
238 */
239#define POLL_IN (__SI_POLL|1) /* data input available */
240#define POLL_OUT (__SI_POLL|2) /* output buffers available */
241#define POLL_MSG (__SI_POLL|3) /* input message available */
242#define POLL_ERR (__SI_POLL|4) /* i/o error */
243#define POLL_PRI (__SI_POLL|5) /* high priority input available */
244#define POLL_HUP (__SI_POLL|6) /* device disconnected */
245#define NSIGPOLL 6
246
247/*
248 * SIGSYS si_codes
249 */
250#define SYS_SECCOMP (__SI_SYS|1) /* seccomp triggered */
251#define NSIGSYS 1
252
253/*
254 * sigevent definitions
255 *
256 * It seems likely that SIGEV_THREAD will have to be handled from
257 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
258 * thread manager then catches and does the appropriate nonsense.
259 * However, everything is written out here so as to not get lost.
260 */
261#define SIGEV_SIGNAL 0 /* notify via signal */
262#define SIGEV_NONE 1 /* other notification: meaningless */
263#define SIGEV_THREAD 2 /* deliver via thread creation */
264#define SIGEV_THREAD_ID 4 /* deliver to thread */
265
266/*
267 * This works because the alignment is ok on all current architectures
268 * but we leave open this being overridden in the future
269 */
270#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
271#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
272#endif
273
274#define SIGEV_MAX_SIZE 64
275#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
276 / sizeof(int))
277
278typedef struct sigevent {
279 sigval_t sigev_value;
280 int sigev_signo;
281 int sigev_notify;
282 union {
283 int _pad[SIGEV_PAD_SIZE];
284 int _tid;
285
286 struct {
287 void (*_function)(sigval_t);
288 void *_attribute; /* really pthread_attr_t */
289 } _sigev_thread;
290 } _sigev_un;
291} sigevent_t;
292
293#define sigev_notify_function _sigev_un._sigev_thread._function
294#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
295#define sigev_notify_thread_id _sigev_un._tid
296
297
298#endif /* _UAPI_ASM_GENERIC_SIGINFO_H */