Mercurial > hg > octave-nkf
comparison src/sighandlers.cc @ 2016:6f3428b0d2c7
[project @ 1996-03-22 09:48:38 by jwe]
author | jwe |
---|---|
date | Fri, 22 Mar 1996 09:49:03 +0000 |
parents | 003570e69c7b |
children | 60f5e1c20815 |
comparison
equal
deleted
inserted
replaced
2015:9e4e71b27b3a | 2016:6f3428b0d2c7 |
---|---|
45 // SIGPIPES. We assume that the writer will eventually give up. | 45 // SIGPIPES. We assume that the writer will eventually give up. |
46 int pipe_handler_error_count = 0; | 46 int pipe_handler_error_count = 0; |
47 | 47 |
48 // Nonzero means we can be interrupted. | 48 // Nonzero means we can be interrupted. |
49 int can_interrupt = 0; | 49 int can_interrupt = 0; |
50 | |
51 // Allow us to save the signal mask and then restore it to the most | |
52 // recently saved value. This is necessary when using the POSIX | |
53 // signal handling interface on some systems calling longjmp out of | |
54 // the signal handler to get to the top level on an interrupt doesn't | |
55 // restore the original signal mask. Alternatively, we could use | |
56 // sigsetjmp/siglongjmp, but saving and restoring the signal mask | |
57 // ourselves works ok and seems simpler just now. | |
58 | |
59 #if defined (HAVE_POSIX_SIGNALS) | |
60 static sigset_t octave_signal_mask; | |
61 #endif | |
62 | |
63 void | |
64 octave_save_signal_mask (void) | |
65 { | |
66 #if defined (HAVE_POSIX_SIGNALS) | |
67 sigprocmask (0, 0, &octave_signal_mask); | |
68 #endif | |
69 } | |
70 | |
71 void | |
72 octave_restore_signal_mask (void) | |
73 { | |
74 #if defined (HAVE_POSIX_SIGNALS) | |
75 sigprocmask (SIG_SETMASK, &octave_signal_mask, 0); | |
76 #endif | |
77 } | |
50 | 78 |
51 static void | 79 static void |
52 my_friendly_exit (const char *sig_name, int sig_number) | 80 my_friendly_exit (const char *sig_name, int sig_number) |
53 { | 81 { |
54 error ("%s -- stopping myself...", sig_name); | 82 error ("%s -- stopping myself...", sig_name); |