3 //=============================================================================
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_SIGNAL_H
15 #define ACE_OS_INCLUDE_OS_SIGNAL_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-lite.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "ace/os_include/sys/os_types.h"
28 # include /**/ <signal.h>
31 #if defined (ACE_HAS_SIGINFO_T)
32 # if !defined (ACE_LACKS_SIGINFO_H)
33 # if defined (ACE_HAS_SYS_SIGINFO_H)
34 # include /**/ <sys/siginfo.h>
35 # else /* ACE_HAS_SYS_SIGINFO_H */
36 # include /**/ <siginfo.h>
37 # endif /* ACE_HAS_SYS_SIGINFO_H */
38 # endif /* ACE_LACKS_SIGINFO_H */
39 #endif /* ACE_HAS_SIGINFO_T */
41 // Place all additions (especially function declarations) within extern "C" {}
45 #endif /* __cplusplus */
47 #if defined (ACE_LACKS_SIGSET_T)
48 typedef u_int sigset_t
;
49 #endif /* ACE_LACKS_SIGSET_T && !sigset_t */
51 #if !defined (ACE_HAS_SIG_ATOMIC_T)
52 typedef int sig_atomic_t;
53 #endif /* !ACE_HAS_SIG_ATOMIC_T */
55 # if !defined (SA_SIGINFO)
57 # endif /* SA_SIGINFO */
59 # if !defined (SA_RESTART)
61 # endif /* SA_RESTART */
71 #if !defined (SIGSEGV)
79 #if !defined (SIGUSR1)
83 #if !defined (SIGUSR2)
87 #if !defined (SIGCHLD)
92 # define SIGCLD SIGCHLD
95 #if !defined (SIGQUIT)
99 #if !defined (SIGPIPE)
103 #if !defined (SIGALRM)
107 #if !defined (SIGABRT)
111 #if !defined (SIGTERM)
115 #if !defined (SIG_DFL)
116 # define SIG_DFL ((__sighandler_t) 0)
119 #if !defined (SIG_IGN)
120 # define SIG_IGN ((__sighandler_t) 1) /* ignore signal */
123 #if !defined (SIG_ERR)
124 # define SIG_ERR ((__sighandler_t) -1) /* error return from signal */
127 // These are used by the <ACE_IPC_SAP::enable> and
128 // <ACE_IPC_SAP::disable> methods. They must be unique and cannot
129 // conflict with the value of <ACE_NONBLOCK>. We make the numbers
130 // negative here so they won't conflict with other values like SIGIO,
132 # define ACE_SIGIO -1
133 # define ACE_SIGURG -2
134 # define ACE_CLOEXEC -3
136 #if defined (ACE_VXWORKS)
137 # define ACE_NSIG (_NSIGS + 1)
138 #elif defined (__Lynx__)
139 # define ACE_NSIG (NSIG + 1)
141 // All other platforms set NSIG to one greater than the
142 // highest-numbered signal.
143 # define ACE_NSIG NSIG
144 #endif /* ACE_VXWORKS */
146 #if defined (ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES)
147 // Prototypes for both signal() and struct sigaction are consistent..
148 using ACE_SignalHandler
= void (*)(int);
149 using ACE_SignalHandlerV
= void (*)(int);
150 #elif defined (ACE_HAS_SVR4_SIGNAL_T)
151 // SVR4 Signals are inconsistent (e.g., see struct sigaction)..
152 using ACE_SignalHandler
= void (*)(int);
153 using ACE_SignalHandlerV
= void (*)();
154 #elif defined (ACE_WIN32)
155 using ACE_SignalHandler
= void (__cdecl
*)(int);
156 using ACE_SignalHandlerV
= void (__cdecl
*)(int);
157 #elif defined (INTEGRITY)
158 using ACE_SignalHandler
= void (*)();
159 using ACE_SignalHandlerV
= void (*)(int);
160 #else /* This is necessary for some older broken version of cfront */
161 # if defined (SIG_PF)
162 # define ACE_SignalHandler SIG_PF
164 using ACE_SignalHandler
= void (*)(int);
166 using ACE_SignalHandlerV
= void (*)(...);
167 #endif /* ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES */
169 #if defined (ACE_LACKS_SIGACTION)
173 ACE_SignalHandlerV sa_handler
;
176 #endif /* ACE_LACKS_SIGACTION */
178 // Defining POSIX4 real-time signal range.
179 #if defined(ACE_HAS_POSIX_REALTIME_SIGNALS)
180 # define ACE_SIGRTMIN SIGRTMIN
181 # define ACE_SIGRTMAX SIGRTMAX
182 #else /* !ACE_HAS_POSIX_REALTIME_SIGNALS */
183 # ifndef ACE_SIGRTMIN
184 # define ACE_SIGRTMIN 0
185 # endif /* ACE_SIGRTMIN */
186 # ifndef ACE_SIGRTMAX
187 # define ACE_SIGRTMAX 0
188 # endif /* ACE_SIGRTMAX */
189 #endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */
193 #endif /* __cplusplus */
195 #include "ace/os_include/os_ucontext.h"
197 #include /**/ "ace/post.h"
198 #endif /* ACE_OS_INCLUDE_OS_SIGNAL_H */