20050223 working copy
[uzi.git] / src / nos / include / signal.h
1 #ifndef __SIGNAL_H
2 #define __SIGNAL_H
3 #ifndef __TYPES_H
4 #include <sys/types.h>
5 #endif
6
7 #define NSIGS           16      /* Number of signals <= 16 */
8
9 #if 1 /* Nick, because the unix() system call needs integer parameters only */
10 #define __NOTASIGNAL 0
11 #define SIGHUP 1                /* Hangup detected on controlling terminal
12                                    or death of a controlling process */
13 #define SIGINT 2                /* Interrupt from keyboard */
14 #define SIGQUIT 3               /* Quit from keyboard */
15 #define SIGILL 4                /* Illegal instruction */
16 #define SIGTRAP 5               /* Trace/breakpoint trap */
17 #define SIGIOT 6                /* IOT trap. A synonym for SIGABRT */
18 #define SIGABRT SIGIOT          /* Abort signal from abort */
19 #define SIGUSR1 7               /* User's signal 1 */
20 #define SIGUSR2 8               /* User's signal 2 */
21 #define SIGKILL 9               /* Kill signal */
22 #define SIGPIPE 10              /* Broken pipe: write to pipe with no readers */
23 #define SIGALRM 11              /* Timer signal from alarm */
24 #define SIGTERM 12              /* Termination signal */
25 #define SIGURG 13                       /* Urgent signal */
26 #define SIGCONT 14              /* Continue process */
27 #define SIGSTOP 15              /* Stop process */
28 #define __NUMOFSIGNALS SIGSTOP
29 /* this signals defined only for compatibility */
30 #define SIGBUS 16               /* Bus error */
31 #define SIGFPE 17               /* Floating point exception */
32 #define SIGSEGV 18              /* Invalid memory reference */
33 #define SIGSYS 19               /* Bad argument to routine */
34 #define SIGTTIN 20
35 #define SIGTOUT 21
36 typedef int signal_t;
37 #else
38 /* signals values */
39 typedef enum {
40         __NOTASIGNAL = 0,
41         SIGHUP,                 /* Hangup detected on controlling terminal
42                                    or death of a controlling process */
43         SIGINT,                 /* Interrupt from keyboard */
44         SIGQUIT,                /* Quit from keyboard */
45         SIGILL,                 /* Illegal instruction */
46         SIGTRAP,                /* Trace/breakpoint trap */
47         SIGIOT,                 /* IOT trap. A synonym for SIGABRT */
48         SIGABRT = SIGIOT,       /* Abort signal from abort */
49         SIGUSR1,                /* User's signal 1 */
50         SIGUSR2,                /* User's signal 2 */
51         SIGKILL,                /* Kill signal */
52         SIGPIPE,                /* Broken pipe: write to pipe with no readers */
53         SIGALRM,                /* Timer signal from alarm */
54         SIGTERM,                /* Termination signal */
55         SIGURG,                 /* Urgent signal */
56         SIGCONT,                /* Continue process */
57         SIGSTOP,                /* Stop process */
58 #define __NUMOFSIGNALS SIGSTOP
59         /* this signals defined only for compatibility */
60         SIGBUS,                 /* Bus error */
61         SIGFPE,                 /* Floating point exception */
62         SIGSEGV,                /* Invalid memory reference */
63         SIGSYS,                 /* Bad argument to routine */
64         SIGTTIN,
65         SIGTOUT
66 } signal_t;
67 #endif
68
69 #if __NUMOFSIGNALS > NSIGS
70  error Too many signals defined
71 #endif
72
73 #define sigmask(sig) (1<<((sig)-1))     /* signal mask */
74
75 typedef uint sigset_t;                  /* at least 16 bits */
76
77 /* Type of a signal handler.  */
78 #if 1 /* Nick, for IAR compiler large or banked memory model */
79 typedef long sig_t;
80 #else
81 typedef void (*sig_t) __P((signal_t));
82 #endif
83
84 #define SIG_DFL ((sig_t)0)      /* default signal handling */
85 #define SIG_IGN ((sig_t)1)      /* ignore signal */
86 #define SIG_ERR ((sig_t)-1)     /* error return from signal */
87
88 #if 0
89 struct sigaction {
90         sig_t sa_handler;
91         sigset_t sa_mask;
92         uint sa_flags;
93         void (*sa_restorer)( /*void*/ );
94 };
95 #endif
96
97 #if 0
98 extern char *sys_siglist[];
99 #endif
100
101 #endif