1
#pragma once
2
3
#include <stdint.h>
4
5
#define SIG_DFL ((sighandler_t)0)
6
#define SIG_IGN ((sighandler_t)(uintptr_t)1)
7
#define SIG_ERR ((sighandler_t)(uintptr_t)-1)
8
9
typedef void (*sighandler_t)(int);
10
typedef void (*sigaction_fn_t)(int);
11
12
typedef int sig_atomic_t;
13
typedef unsigned int sigset_t;
14
15
#define SIGHUP 1
16
#define SIGINT 2
17
#define SIGQUIT 3
18
#define SIGILL 4
19
#define SIGTRAP 5
20
#define SIGABRT 6
21
#define SIGBUS 7
22
#define SIGFPE 8
23
#define SIGKILL 9
24
#define SIGUSR1 10
25
#define SIGSEGV 11
26
#define SIGUSR2 12
27
#define SIGPIPE 13
28
#define SIGALRM 14
29
#define SIGTERM 15
30
#define SIGCHLD 17
31
#define SIGCONT 18
32
#define SIGSTOP 19
33
#define SIGTSTP 20
34
#define SIGTTIN 21
35
#define SIGTTOU 22
36
#define SIGURG 23
37
#define SIGXCPU 24
38
#define SIGXFSZ 25
39
#define SIGVTALRM 26
40
#define SIGPROF 27
41
#define SIGWINCH 28
42
#define SIGIO 29
43
#define SIGPWR 30
44
#define SIGSYS 31
45
46
#define NSIG 32
47
48
#define SIG_BLOCK 0
49
#define SIG_UNBLOCK 1
50
#define SIG_SETMASK 2
51
52
#define SA_NOCLDSTOP 0x0001
53
#define SA_NOCLDWAIT 0x0002
54
#define SA_SIGINFO 0x0004
55
#define SA_RESTART 0x0008
56
#define SA_ONSTACK 0x0010
57
#define SA_RESETHAND 0x0020
58
#define SA_NODEFER 0x0040
59
60
struct sigaction {
61
sigaction_fn_t sa_handler;62
sigset_t sa_mask;63
int sa_flags;
64
void (*sa_restorer)(void);
65
};
66
67
#ifndef _KERNEL
68
#include <libc_usr/signal.h>
69
#endif