fill in some missing siginfo stuff in signal.h
[musl] / arch / i386 / bits / signal.h
1 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
3
4 struct __fpstate {
5         unsigned long __x[7];
6         unsigned char __y[80];
7         unsigned long __z;
8 };
9
10 typedef struct {
11         unsigned long __gregs[19];
12         void *__fpregs;
13         unsigned long __oldmask, __cr2;
14 } mcontext_t;
15
16 typedef struct __ucontext {
17         unsigned long uc_flags;
18         struct __ucontext *uc_link;
19         stack_t uc_stack;
20         mcontext_t uc_mcontext;
21         sigset_t uc_sigmask;
22         struct __fpstate __fpregs_mem;
23 } ucontext_t;
24
25 #ifdef _GNU_SOURCE
26 struct sigcontext {
27         unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
28         unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
29         unsigned long trapno, err, eip;
30         unsigned short cs, __csh;
31         unsigned long eflags, esp_at_signal;
32         unsigned short ss, __ssh;
33         struct __fpstate *fpstate;
34         unsigned long oldmask, cr2;
35 };
36 #endif
37
38 struct __siginfo
39 {
40         int si_signo;
41         int si_errno;
42         int si_code;
43         union
44         {
45                 char __pad[128 - 3*sizeof(int)];
46                 struct {
47                         pid_t si_pid;
48                         uid_t si_uid;
49                         union sigval si_sigval;
50                 } __rt;
51                 struct {
52                         unsigned int si_timer1;
53                         unsigned int si_timer2;
54                 } __timer;
55                 struct {
56                         pid_t si_pid;
57                         uid_t si_uid;
58                         int si_status;
59                         clock_t si_utime;
60                         clock_t si_stime;
61                 } __sigchld;
62                 struct {
63                         void *si_addr;
64                 } __sigfault;
65                 struct {
66                         long int si_band;
67                         int si_fd;
68                 } __sigpoll;
69         } __si_fields;
70 };
71
72 #define si_pid     __si_fields.__sigchld.si_pid
73 #define si_uid     __si_fields.__sigchld.si_uid
74 #define si_status  __si_fields.__sigchld.si_status
75 #define si_utime   __si_fields.__sigchld.si_utime
76 #define si_stime   __si_fields.__sigchld.si_stime
77 #define si_value   __si_fields.__rt.si_sigval
78 #define si_addr    __si_fields.__sigfault.si_addr
79 #define si_band    __si_fields.__sigpoll.si_band
80
81 #define SI_ASYNCNL (-60)
82 #define SI_TKILL (-6)
83 #define SI_SIGIO (-5)
84 #define SI_ASYNCIO (-4)
85 #define SI_MESGQ (-3)
86 #define SI_TIMER (-2)
87 #define SI_QUEUE (-1)
88 #define SI_USER 0
89 #define SI_KERNEL 128
90
91 #define FPE_INTDIV 1
92 #define FPE_INTOVF 2
93 #define FPE_FLTDIV 3
94 #define FPE_FLTOVF 4
95 #define FPE_FLTUNT 5
96 #define FPE_FLTRES 6
97 #define FPE_FLTINV 7
98 #define FPE_FLTSUB 8
99
100 #define ILL_ILLOPC 1
101 #define ILL_ILLOPN 2
102 #define ILL_ILLADR 3
103 #define ILL_ILLTRP 4
104 #define ILL_PRVOPC 5
105 #define ILL_PRVREG 6
106 #define ILL_COPROC 7
107 #define ILL_BADSTK 8
108
109 #define SEGV_MAPERR 1
110 #define SEGV_ACCERR 2
111
112 #define BUS_ADRALN 1
113 #define BUS_ADRERR 2
114 #define BUS_OBJERR 3
115
116 #define CLD_EXITED 1
117 #define CLD_KILLED 2
118 #define CLD_DUMPED 3
119 #define CLD_TRAPPED 4
120 #define CLD_STOPPED 5
121 #define CLD_CONTINUED 6
122
123 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
124 #define TRAP_BRKPT 1
125 #define TRAP_TRACE 2
126 #define POLL_IN 1
127 #define POLL_OUT 2
128 #define POLL_MSG 3
129 #define POLL_ERR 4
130 #define POLL_PRI 5
131 #define POLL_HUP 6
132 #define SS_ONSTACK    1
133 #define SS_DISABLE    2
134 #endif
135
136 #define SA_NOCLDSTOP  1
137 #define SA_NOCLDWAIT  2
138 #define SA_SIGINFO    4
139 #define SA_ONSTACK    0x08000000
140 #define SA_RESTART    0x10000000
141 #define SA_NODEFER    0x40000000
142 #define SA_RESETHAND  0x80000000
143 #define SA_RESTORER   0x04000000
144
145 #define SIG_BLOCK     0
146 #define SIG_UNBLOCK   1
147 #define SIG_SETMASK   2
148
149 #endif
150
151 #ifdef _GNU_SOURCE
152 #define NSIG      64
153 #endif
154
155 #define SIG_ERR  ((void (*)(int))-1)
156 #define SIG_DFL  ((void (*)(int)) 0)
157 #define SIG_IGN  ((void (*)(int)) 1)
158 #define SIG_HOLD ((void (*)(int)) 2)
159
160 #define SIGHUP    1
161 #define SIGINT    2
162 #define SIGQUIT   3
163 #define SIGILL    4
164 #define SIGTRAP   5
165 #define SIGABRT   6
166 #define SIGBUS    7
167 #define SIGFPE    8
168 #define SIGKILL   9
169 #define SIGUSR1   10
170 #define SIGSEGV   11
171 #define SIGUSR2   12
172 #define SIGPIPE   13
173 #define SIGALRM   14
174 #define SIGTERM   15
175 #define SIGSTKFLT 16
176 #define SIGCHLD   17
177 #define SIGCONT   18
178 #define SIGSTOP   19
179 #define SIGTSTP   20
180 #define SIGTTIN   21
181 #define SIGTTOU   22
182 #define SIGURG    23
183 #define SIGXCPU   24
184 #define SIGXFSZ   25
185 #define SIGVTALRM 26
186 #define SIGPROF   27
187 #define SIGWINCH  28
188 #define SIGIO     29
189 #define SIGPOLL   29
190 #define SIGPWR    30
191 #define SIGSYS    31
192 #define SIGUNUSED SIGSYS