26 #if defined (HAVE_CONFIG_H)
30 #include <sys/types.h>
35 #if defined (__WIN32__) && ! defined (__CYGWIN__)
43 #if ! defined (__WIN32__) || defined (__CYGWIN__)
71 sigemptyset (&sigmask);
79 sigaddset (&sigmask, SIGINT);
82 #if defined (SIGBREAK)
83 sigaddset (&sigmask, SIGBREAK);
89 sigaddset (&sigmask, SIGHUP);
93 sigaddset (&sigmask, SIGQUIT);
97 sigaddset (&sigmask, SIGTERM);
102 #if defined (SIGALRM)
103 sigaddset (&sigmask, SIGALRM);
106 #if defined (SIGVTALRM)
107 sigaddset (&sigmask, SIGVTALRM);
112 #if defined (SIGLOST)
113 sigaddset (&sigmask, SIGLOST);
116 #if defined (SIGPIPE)
117 sigaddset (&sigmask, SIGPIPE);
122 #if defined (SIGCHLD)
123 sigaddset (&sigmask, SIGCHLD);
127 sigaddset (&sigmask, SIGCLD);
132 #if defined (SIGXCPU)
133 sigaddset (&sigmask, SIGXCPU);
136 #if defined (SIGXFSZ)
137 sigaddset (&sigmask, SIGXFSZ);
146 static const sigset_t async_signals = init_async_signals ();
153 #if ! defined (__WIN32__) || defined (__CYGWIN__)
154 pthread_sigmask (SIG_BLOCK, &async_signals, 0);
161 #if ! defined (__WIN32__) || defined (__CYGWIN__)
162 pthread_sigmask (SIG_UNBLOCK, &async_signals, 0);
166 #if ! defined (__WIN32__) || defined (__CYGWIN__)
169 signal_watcher (
void *arg)
179 if (sigwait (&async_signals, &sig_caught))
186 (*handler) (sig_caught);
195 #if ! defined (__WIN32__)
196 pthread_t sighandler_thread_id;
198 if (pthread_create (&sighandler_thread_id, 0, signal_watcher,
199 reinterpret_cast<void *
> (handler)))
207 octave_unused_parameter (handler);
void octave_create_interrupt_watcher_thread(octave_sig_handler *handler)
void octave_unblock_async_signals()
void octave_block_async_signals()
void octave_sig_handler(int)