1 //===-- Definition of siginfo_t type --------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_TYPES_SIGINFO_T_H
10 #define LLVM_LIBC_TYPES_SIGINFO_T_H
15 #include "union_sigval.h"
17 #define SI_MAX_SIZE 128
20 int si_signo
; /* Signal number. */
21 int si_errno
; /* If non-zero, an errno value associated with
22 this signal, as defined in <errno.h>. */
23 int si_code
; /* Signal code. */
25 int _si_pad
[SI_MAX_SIZE
/ sizeof(int)];
29 pid_t si_pid
; /* sender's pid */
30 uid_t si_uid
; /* sender's uid */
35 int si_tid
; /* timer id */
36 int _overrun
; /* overrun count */
37 union sigval si_sigval
; /* same as below */
40 /* POSIX.1b signals */
42 pid_t si_pid
; /* sender's pid */
43 uid_t si_uid
; /* sender's uid */
44 union sigval si_sigval
;
49 pid_t si_pid
; /* which child */
50 uid_t si_uid
; /* sender's uid */
51 int si_status
; /* exit code */
56 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
58 void *si_addr
; /* faulting insn/memory ref. */
59 short int si_addr_lsb
; /* Valid LSB of the reported address. */
61 /* used when si_code=SEGV_BNDERR */
66 /* used when si_code=SEGV_PKUERR */
67 __UINT32_TYPE__ _pkey
;
73 long int si_band
; /* POLL_IN, POLL_OUT, POLL_MSG */
79 void *_call_addr
; /* calling user insn */
80 int _syscall
; /* triggering system call number */
81 unsigned int _arch
; /* AUDIT_ARCH_* of syscall */
88 #define si_pid _sifields._kill.si_pid
89 #define si_uid _sifields._kill.si_uid
90 #define si_timerid _sifields._timer.si_tid
91 #define si_overrun _sifields._timer.si_overrun
92 #define si_status _sifields._sigchld.si_status
93 #define si_utime _sifields._sigchld.si_utime
94 #define si_stime _sifields._sigchld.si_stime
95 #define si_value _sifields._rt.si_sigval
96 #define si_int _sifields._rt.si_sigval.sival_int
97 #define si_ptr _sifields._rt.si_sigval.sival_ptr
98 #define si_addr _sifields._sigfault.si_addr
99 #define si_addr_lsb _sifields._sigfault.si_addr_lsb
100 #define si_lower _sifields._sigfault._bounds._addr_bnd._lower
101 #define si_upper _sifields._sigfault._bounds._addr_bnd._upper
102 #define si_pkey _sifields._sigfault._bounds._pkey
103 #define si_band _sifields._sigpoll.si_band
104 #define si_fd _sifields._sigpoll.si_fd
105 #define si_call_addr _sifields._sigsys._call_addr
106 #define si_syscall _sifields._sigsys._syscall
107 #define si_arch _sifields._sigsys._arch
109 #endif // LLVM_LIBC_TYPES_SIGINFO_T_H