Usermode/libc - Fix strchr and strrchr behavior
[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 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #include "signal_list.h"
16
17 typedef void (*sighandler_t)(int);
18
19 //! Atomic integer type
20 typedef volatile int    sig_atomic_t;
21
22 #define SIG_IGN ((sighandler_t)1)
23 #define SIG_DFL ((sighandler_t)0)
24 #define SIG_ERR ((sighandler_t)-1)
25
26 extern sighandler_t     signal(int signum, sighandler_t handler);
27
28 extern int      raise(int sig);
29
30 #include <sys/types.h>  // libposix
31
32 typedef long long unsigned int  sigset_t;
33 extern int      sigemptyset(sigset_t *set);
34 extern int      sigfillset(sigset_t *set);
35
36 typedef struct siginfo_s        siginfo_t;
37
38 struct siginfo_s
39 {
40         int     si_signo;
41         int     si_errno;
42         int     si_code;
43         int     si_trapno;
44         pid_t   si_pid;
45         uid_t   si_uid;
46         int     si_status;
47         // TODO: There's others
48 };
49
50 struct sigaction
51 {
52         sighandler_t    sa_handler;
53         //void  (*sa_sigaction)(int, siginfo_t *, void *);
54         sigset_t        sa_mask;
55         int     sa_flags;
56 };
57
58 #define SA_NOCLDSTOP    0x001
59
60 extern int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
61
62 #if __cplusplus
63 }
64 #endif
65
66 #endif
67

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