1macro-constant SIG_DFL {void(*)(int)}
2macro-constant SIG_ERR {void(*)(int)}
3#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
4macro-constant SIG_HOLD {void(*)(int)}
5#endif
6macro-constant SIG_IGN {void(*)(int)}
7
8type sig_atomic_t
9#if !defined ISO && !defined ISO99 && !defined ISO11
10type sigset_t
11#endif
12#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
13type pid_t
14#elif defined POSIX
15# define pid_t __pid_t
16# define uid_t __uid_t
17#endif
18#if defined XOPEN2K8 || defined POSIX2008
19type size_t
20type pthread_t
21type uid_t
22
23type mcontext_t
24
25type ucontext_t
26element ucontext_t {ucontext_t*} uc_link
27// Bug 21634: uc_sigmask has wrong type.
28xfail[ia64-linux]-element ucontext_t sigset_t uc_sigmask
29element ucontext_t stack_t uc_stack
30// Bug 21635: uc_mcontext has wrong type.
31xfail[powerpc32-linux]-element ucontext_t mcontext_t uc_mcontext
32
33type {struct timespec}
34element {struct timespec} __time_t tv_sec
35// Bug 16437: tv_nsec has wrong type.
36xfail[x86_64-x32-linux]-element {struct timespec} long tv_nsec
37#endif
38
39#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
40element {union sigval} int sival_int
41element {union sigval} {void*} sival_ptr
42
43type {struct sigevent}
44
45// Test the elements of the sigevent_t structure.
46element {struct sigevent} int sigev_notify
47element {struct sigevent} int sigev_signo
48element {struct sigevent} {union sigval} sigev_value
49element {struct sigevent} {void(*} sigev_notify_function )(union sigval)
50element {struct sigevent} {pthread_attr_t*} sigev_notify_attributes
51
52constant SIGEV_NONE
53constant SIGEV_SIGNAL
54constant SIGEV_THREAD
55
56type {union sigval}
57
58macro SIGRTMIN
59macro SIGRTMAX
60#endif
61
62macro-int-constant SIGABRT {int} > 0
63macro-int-constant SIGFPE {int} > 0
64macro-int-constant SIGILL {int} > 0
65macro-int-constant SIGINT {int} > 0
66macro-int-constant SIGSEGV {int} > 0
67macro-int-constant SIGTERM {int} > 0
68
69function void (*signal (int, void(*)(int)))(int)
70function int raise (int)
71
72#if !defined ISO && !defined ISO99 && !defined ISO11
73macro-int-constant SIGALRM {int} > 0
74macro-int-constant SIGHUP {int} > 0
75macro-int-constant SIGKILL {int} > 0
76macro-int-constant SIGPIPE {int} > 0
77macro-int-constant SIGQUIT {int} > 0
78macro-int-constant SIGUSR1 {int} > 0
79macro-int-constant SIGUSR2 {int} > 0
80macro-int-constant SIGCHLD {int} > 0
81macro-int-constant SIGCONT {int} > 0
82macro-int-constant SIGSTOP {int} > 0
83macro-int-constant SIGTSTP {int} > 0
84macro-int-constant SIGTTIN {int} > 0
85macro-int-constant SIGTTOU {int} > 0
86# ifndef XPG4
87macro-int-constant SIGBUS {int} > 0
88# endif
89# if !defined POSIX && !defined XPG4
90macro-int-constant SIGPOLL {int} > 0
91macro-int-constant SIGPROF {int} > 0
92macro-int-constant SIGSYS {int} > 0
93# endif
94# if !defined POSIX && !defined XPG4 && !defined POSIX2008
95macro-int-constant SIGTRAP {int} > 0
96# endif
97# if !defined POSIX && !defined XPG4
98macro-int-constant SIGURG {int} > 0
99macro-int-constant SIGVTALRM {int} > 0
100macro-int-constant SIGXCPU {int} > 0
101macro-int-constant SIGXFSZ {int} > 0
102# endif
103
104type {struct sigaction}
105
106element {struct sigaction} {void(*} sa_handler )(int)
107element {struct sigaction} sigset_t sa_mask
108element {struct sigaction} int sa_flags
109# ifndef XPG4
110element {struct sigaction} {void(*} sa_sigaction )(int, siginfo_t*, void*)
111# endif
112
113constant SA_NOCLDSTOP
114# ifndef XPG4
115constant SA_SIGINFO
116# endif
117constant SIG_BLOCK
118constant SIG_UNBLOCK
119constant SIG_SETMASK
120# if !defined XPG4 && !defined POSIX && !defined POSIX2008
121constant SA_ONSTACK
122# endif
123# if !defined XPG4 && !defined POSIX
124constant SA_RESETHAND
125constant SA_RESTART
126// Bug 23090: hurd: missing SA_NOCLDWAIT support.
127xfail[i386-gnu]-constant SA_NOCLDWAIT
128constant SA_NODEFER
129# endif
130# if !defined XPG4 && !defined POSIX && !defined POSIX2008
131constant SS_ONSTACK
132constant SS_DISABLE
133constant MINSIGSTKSZ
134constant SIGSTKSZ
135# endif
136
137# if !defined XPG4 && !defined POSIX
138type ucontext_t
139
140element ucontext_t {ucontext_t*} uc_link
141// Bug 21634: uc_sigmask has wrong type.
142xfail[ia64-linux]-element ucontext_t sigset_t uc_sigmask
143element ucontext_t stack_t uc_stack
144// Bug 21635: uc_mcontext has wrong type.
145xfail[powerpc32-linux]-element ucontext_t mcontext_t uc_mcontext
146
147type stack_t
148
149element stack_t {void*} ss_sp
150element stack_t size_t ss_size
151element stack_t int ss_flags
152
153#  if !defined XOPEN2K8 && !defined POSIX2008
154type {struct sigstack}
155
156element {struct sigstack} int ss_onstack
157element {struct sigstack} {void*} ss_sp
158#  endif
159# endif
160
161# ifndef XPG4
162type siginfo_t
163
164element siginfo_t int si_signo
165#  if !defined POSIX && !defined POSIX2008
166element siginfo_t int si_errno
167#  endif
168element siginfo_t int si_code
169#  ifndef POSIX
170element siginfo_t pid_t si_pid
171element siginfo_t uid_t si_uid
172element siginfo_t {void*} si_addr
173element siginfo_t int si_status
174// Bug 23821: si_band has type int on sparc64.
175xfail[sparc64-linux]-element siginfo_t long si_band
176#  endif
177#  ifndef XPG42
178element siginfo_t {union sigval} si_value
179#  endif
180# endif
181
182# if !defined POSIX && !defined XPG4
183constant ILL_ILLOPC
184constant ILL_ILLOPN
185constant ILL_ILLADR
186constant ILL_ILLTRP
187constant ILL_PRVOPC
188constant ILL_PRVREG
189constant ILL_COPROC
190constant ILL_BADSTK
191constant FPE_INTDIV
192constant FPE_INTOVF
193constant FPE_FLTDIV
194constant FPE_FLTOVF
195constant FPE_FLTUND
196constant FPE_FLTRES
197constant FPE_FLTINV
198constant FPE_FLTSUB
199constant SEGV_MAPERR
200constant SEGV_ACCERR
201constant BUS_ADRALN
202constant BUS_ADRERR
203constant BUS_OBJERR
204constant CLD_EXITED
205constant CLD_KILLED
206constant CLD_DUMPED
207constant CLD_TRAPPED
208constant CLD_STOPPED
209constant CLD_CONTINUED
210constant POLL_IN
211constant POLL_OUT
212constant POLL_MSG
213constant POLL_ERR
214constant POLL_PRI
215constant POLL_HUP
216# endif
217# if !defined POSIX && !defined XPG4 && !defined POSIX2008
218constant TRAP_BRKPT
219constant TRAP_TRACE
220# endif
221# if !defined XPG4 && !defined XPG42
222constant SI_USER
223constant SI_QUEUE
224constant SI_TIMER
225constant SI_ASYNCIO
226constant SI_MESGQ
227# endif
228
229# if !defined XPG4 && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008
230function void (*bsd_signal (int, void(*)(int)))(int)
231# endif
232function int kill (pid_t, int)
233# if !defined XPG4 && !defined POSIX && !defined POSIX2008
234function int killpg (pid_t, int)
235# endif
236# if !defined XPG4 && !defined XPG42
237function int pthread_kill (pthread_t, int)
238function int pthread_sigmask (int, const sigset_t*, sigset_t*)
239# endif
240function int sigaction (int, const struct sigaction*, struct sigaction*)
241function int sigaddset (sigset_t*, int)
242# if !defined XPG4 && !defined POSIX && !defined POSIX2008
243function int sigaltstack (const stack_t*, stack_t*)
244# endif
245function int sigdelset (sigset_t*, int)
246function int sigemptyset (sigset_t*)
247function int sigfillset (sigset_t*)
248# if !defined XPG4 && !defined POSIX && !defined POSIX2008
249function int sighold (int)
250function int sigignore (int)
251function int siginterrupt (int, int)
252# endif
253function int sigismember (const sigset_t*, int)
254#if !defined XPG4 && !defined POSIX && !defined POSIX2008
255function int sigpause (int)
256# endif
257function int sigpending (sigset_t*)
258function int sigprocmask (int, const sigset_t*, sigset_t*)
259# if !defined XPG4 && !defined XPG42
260function int sigqueue (pid_t, int, const union sigval)
261# endif
262# if !defined XPG4 && !defined POSIX && !defined POSIX2008
263function int sigrelse (int)
264function void (*sigset (int, void(*)(int)))(int)
265# endif
266# if defined XPG42 || defined UNIX98
267function int sigstack (struct sigstack*, struct sigstack*)
268# endif
269function int sigsuspend (const sigset_t*)
270# if !defined XPG4 && !defined XPG42
271function int sigtimedwait (const sigset_t*, siginfo_t*, const struct timespec*)
272# endif
273# if !defined XPG4 && !defined XPG42
274function int sigwait (const sigset_t*, int*)
275function int sigwaitinfo (const sigset_t*, siginfo_t*)
276# endif
277# if defined XOPEN2K8 || defined POSIX2008
278function void psiginfo (const siginfo_t*, const char*)
279function void psignal (int, const char*)
280# endif
281
282// The following expressions are not entirely correct but the current
283// poorfnmatch implementation doesn't grok the right form.
284allow sa_*
285allow SA_*
286# ifndef XPG4
287allow si_*
288allow SI_*
289# endif
290# if !defined XPG4 && !defined XPG42
291allow sigev_*
292allow SIGEV_*
293allow sival_*
294# endif
295# if !defined POSIX && !defined XPG4 && !defined XPG42
296allow uc_*
297# endif
298# if !defined POSIX && !defined XPG4
299allow BUS_*
300allow CLD_*
301allow FPE_*
302allow ILL_*
303allow POLL_*
304allow SEGV_*
305# endif
306# if !defined POSIX && !defined XPG4 && !defined POSIX2008
307allow SS_*
308allow SV_*
309allow TRAP_*
310allow ss_*
311allow sv_*
312# endif
313allow *_t
314
315allow-header time.h
316#endif
317
318allow SIG[ABCDEFGHIJKLMNOPQRSTUVWXYZ]*
319allow SIG_*
320