versadac  1
versadac - Scalable Recorder Firmware
vxsignal.h
1 /* signal.h - signal facility library header */
2 
3 /* Copyright 1984-1994 Wind River Systems, Inc. */
4 
5 /*
6 modification history
7 --------------------
8 02k,09nov00,jgn remove inaccurate comment from SIGKILL (SPR #35996)
9 02j,19jul00,jgn add thread cancellation signal for pthreads support +
10  update the sigwait prototype to match the POSIX version
11 02i,11nov94,kdl provide paramless func ptrs in structs, for non-ANSI (SPR 3742)
12 02h,10nov94,caf adjusted placement of _ASMLANGUAGE conditional.
13 02g,06oct93,yao added _ASMLANGUAGE conditional.
14 02h,12jan94,kdl added sigqueue() prototype.
15 02g,09nov93,rrr update to posix 1003.4 draft 14
16 02f,05feb93,rrr fixed spr 1986 (SIG_ERR ... prototype) and
17  spr 1906 (signal numbers to match sun os)
18 02e,15oct92,rrr silenced warnings
19 02d,22sep92,rrr added support for c++
20 02c,22aug92,rrr added bsd prototypes.
21 02b,27jul92,smb added prototype for raise().
22 02a,04jul92,jcf cleaned up.
23 01b,26may92,rrr the tree shuffle
24 01a,19feb92,rrr written from posix spec
25 */
26 
27 #ifndef __INCsignalh
28 #define __INCsignalh
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifndef _ASMLANGUAGE
35 #include "sigevent.h"
36 
37 struct timespec;
38 #endif /* _ASMLANGUAGE */
39 
40 #define SIGEV_NONE 0
41 #define SIGEV_SIGNAL 1
42 
43 /*
44  * Signal Numbers:
45  * Required .1 signals 1-13
46  * Job Control signals 14-19 (not implemented but must be defined)
47  * Realtime signals 20-27
48  */
49 #define SIGHUP 1 /* hangup */
50 #define SIGINT 2 /* interrupt */
51 #define SIGQUIT 3 /* quit */
52 #define SIGILL 4 /* illegal instruction (not reset when caught) */
53 #define SIGTRAP 5 /* trace trap (not reset when caught) */
54 #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
55 #define SIGEMT 7 /* EMT instruction */
56 #define SIGFPE 8 /* floating point exception */
57 #define SIGKILL 9 /* kill */
58 #define SIGBUS 10 /* bus error */
59 #define SIGSEGV 11 /* segmentation violation */
60 #define SIGFMT 12 /* STACK FORMAT ERROR (not posix) */
61 #define SIGPIPE 13 /* write on a pipe with no one to read it */
62 #define SIGALRM 14 /* alarm clock */
63 #define SIGTERM 15 /* software termination signal from kill */
64 #define SIGCNCL 16 /* pthreads cancellation signal */
65 #define SIGSTOP 17 /* sendable stop signal not from tty */
66 #define SIGTSTP 18 /* stop signal from tty */
67 #define SIGCONT 19 /* continue a stopped process */
68 #define SIGCHLD 20 /* to parent on child stop or exit */
69 #define SIGTTIN 21 /* to readers pgrp upon background tty read */
70 #define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
71 
72 #define SIGUSR1 30 /* user defined signal 1 */
73 #define SIGUSR2 31 /* user defined signal 2 */
74 
75 #define SIGRTMIN 23 /* Realtime signal min */
76 #define SIGRTMAX 29 /* Realtime signal max */
77 
78 
79 #define _NSIGS 31
80 
81 #ifndef _ASMLANGUAGE
82 /*
83  * ANSI Args and returns from signal()
84  */
85 #if defined(__STDC__) || defined(__cplusplus)
86 
87 #define SIG_ERR (void (*)(int))-1
88 #define SIG_DFL (void (*)(int))0
89 #define SIG_IGN (void (*)(int))1
90 
91 #else
92 
93 #define SIG_ERR (void (*)())-1
94 #define SIG_DFL (void (*)())0
95 #define SIG_IGN (void (*)())1
96 
97 #endif
98 
99 /*
100  * The sa_flags in struct sigaction
101  */
102 #define SA_NOCLDSTOP 0x0001 /* Do not generate SIGCHLD when children stop */
103 #define SA_SIGINFO 0x0002 /* Pass additional siginfo structure */
104 #define SA_ONSTACK 0x0004 /* (Not posix) Run on sigstack */
105 #define SA_INTERRUPT 0x0008 /* (Not posix) Don't restart the function */
106 #define SA_RESETHAND 0x0010 /* (Not posix) Reset the handler, like sysV */
107 
108 /*
109  * The how in sigprocmask()
110  */
111 #define SIG_BLOCK 1
112 #define SIG_UNBLOCK 2
113 #define SIG_SETMASK 3
114 
115 /*
116  * The si_code returned in siginfo
117  */
118 #define SI_SYNC 0 /* (Not posix) gernerated by hardware */
119 #define SI_KILL 1 /* signal from .1 kill() function */
120 #define SI_QUEUE 2 /* signal from .4 sigqueue() function */
121 #define SI_TIMER 3 /* signal from expiration of a .4 timer */
122 #define SI_ASYNCIO 4 /* signal from completion of an async I/O */
123 #define SI_MESGQ 5 /* signal from arrival of a message */
124 
125 typedef unsigned long sigset_t;
126 /*typedef unsigned char sig_atomic_t; VXWORKS_BUILD fix*/
127 
128 typedef struct siginfo
129  {
130  int si_signo;
131  int si_code;
132  union sigval si_value;
133  } siginfo_t;
134 
135 struct sigaction
136  {
137  union
138  {
139 #if defined(__STDC__) || defined(__cplusplus)
140  void (*__sa_handler)(int);
141  void (*__sa_sigaction)(int, siginfo_t *, void *);
142 #else
143  void (*__sa_handler)();
144  void (*__sa_sigaction)();
145 #endif /* __STDC__ */
146  } sa_u;
147 #define sa_handler sa_u.__sa_handler
148 #define sa_sigaction sa_u.__sa_sigaction
149  sigset_t sa_mask;
150  int sa_flags;
151  };
152 
153 #if defined(__STDC__) || defined(__cplusplus)
154 
155 extern void (*signal(int __sig, void (*__handler)(int)))(int);
156 extern int raise(int __signo);
157 extern int kill(int __tid, int __signo);
158 
159 extern int sigemptyset(sigset_t *__set);
160 extern int sigfillset(sigset_t *__set);
161 extern int sigaddset(sigset_t *__set, int __signo);
162 extern int sigdelset(sigset_t *__set, int __signo);
163 extern int sigismember(const sigset_t *__set, int __signo);
164 extern int sigaction(int __sig, const struct sigaction *__act,
165  struct sigaction *__oact);
166 extern int sigprocmask(int __how, const sigset_t *__set, sigset_t *__oset);
167 extern int sigpending(sigset_t *__set);
168 extern int sigsuspend(const sigset_t *__sigmask);
169 extern int sigwait(const sigset_t *__set, int* sig);
170 extern int sigwaitinfo(const sigset_t *__set, struct siginfo *__value);
171 extern int sigtimedwait(const sigset_t *__set, struct siginfo *__value,
172  const struct timespec *);
173 extern int sigqueue (int tid, int signo, const union sigval value);
174 
175 #else
176 
177 extern void (*signal())();
178 extern int raise();
179 extern int kill();
180 extern int sigemptyset();
181 extern int sigfillset();
182 extern int sigaddset();
183 extern int sigdelset();
184 extern int sigismember();
185 extern int sigaction();
186 extern int sigprocmask();
187 extern int sigpending();
188 extern int sigsuspend();
189 extern int sigwait();
190 extern int sigwaitinfo();
191 extern int sigtimedwait();
192 extern int sigqueue ();
193 
194 #endif /* __STDC__ */
195 
196 
197 /*
198  * From here to the end is not posix, it is for bsd compatibility.
199  */
200 #define SV_ONSTACK SA_ONSTACK
201 #define SV_INTERRUPT SA_INTERRUPT
202 #define SV_RESETHAND SA_RESETHAND
203 
204 #define sigmask(m) (1 << ((m)-1))
205 #define SIGMASK(m) (1 << ((m)-1))
206 
207 struct sigvec
208  {
209 #if defined(__STDC__) || defined(__cplusplus)
210  void (*sv_handler)(int); /* signal handler */
211 #else
212  void (*sv_handler)(); /* signal handler */
213 #endif /* __STDC__ */
214  int sv_mask; /* signal mask to apply */
215  int sv_flags; /* see signal options */
216  };
217 
218 struct sigcontext;
219 
220 #if defined(__STDC__) || defined(__cplusplus)
221 
222 extern int sigvec(int __sig, const struct sigvec *__vec,
223  struct sigvec *__ovec);
224 extern void sigreturn(struct sigcontext *__context);
225 extern int sigsetmask(int __mask);
226 extern int sigblock(int __mask);
227 
228 #else
229 
230 extern int sigvec();
231 extern void sigreturn();
232 extern int sigsetmask();
233 extern int sigblock();
234 
235 #endif
236 
237 #endif /* _ASMLANGUAGE */
238 
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 #endif /* __INCsignalh */
Definition: vxsignal.h:128
Definition: vxsignal.h:207
Definition: vxsignal.h:135