a4c8bd3f0127d472f33baf5442b6fd9d37e2d978
[tpg/acess2.git] / Usermode / Libraries / libc.so_src / include_exp / signal.h
1 /*
2  * Acess2 C Library
3  * - By John Hodge (thePowersGang)
4  *
5  * signal.h
6  * - POSIX Signal Emulation/Interface
7  */
8 #ifndef _SIGNAL_H_
9 #define _SIGNAL_H_
10
11 #include "signal_list.h"
12
13 typedef void (*sighandler_t)(int);
14
15 //! Atomic integer type
16 typedef volatile int    sig_atomic_t;
17
18 #define SIG_IGN ((void*)1)
19 #define SIG_DFL ((void*)0)
20 #define SIG_ERR ((void*)-1)
21
22 extern sighandler_t     signal(int signum, sighandler_t handler);
23
24 extern int      raise(int sig);
25
26 #include <sys/types.h>  // libposix
27
28 typedef long long unsigned int  sigset_t;
29 extern int      sigemptyset(sigset_t *set);
30 extern int      sigfillset(sigset_t *set);
31
32 typedef struct siginfo_s        siginfo_t;
33
34 struct siginfo_s
35 {
36         int     si_signo;
37         int     si_errno;
38         int     si_code;
39         int     si_trapno;
40         pid_t   si_pid;
41         uid_t   si_uid;
42         int     si_status;
43         // TODO: There's others
44 };
45
46 struct sigaction
47 {
48         sighandler_t    sa_handler;
49         //void  (*sa_sigaction)(int, siginfo_t *, void *);
50         sigset_t        sa_mask;
51         int     sa_flags;
52 };
53
54 #define SA_NOCLDSTOP    0x001
55
56 extern int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
57
58 #endif
59

UCC git Repository :: git.ucc.asn.au