comparison src/sighandlers.h @ 2693:f4d0604cbcc4

[project @ 1997-02-18 15:25:21 by jwe]
author jwe
date Tue, 18 Feb 1997 15:25:23 +0000
parents f7e3d23f0a8f
children 18395aaeafb7
comparison
equal deleted inserted replaced
2692:25fbbe6074e9 2693:f4d0604cbcc4
33 #ifndef RETSIGTYPE 33 #ifndef RETSIGTYPE
34 #define RETSIGTYPE void 34 #define RETSIGTYPE void
35 #endif 35 #endif
36 #ifndef BADSIG 36 #ifndef BADSIG
37 #define BADSIG (RETSIGTYPE (*)(int))-1 37 #define BADSIG (RETSIGTYPE (*)(int))-1
38 #endif
39
40 // The following signal blocking stuff is stolen from bash:
41
42 #define BLOCK_SIGNAL(sig, nvar, ovar) \
43 do \
44 { \
45 sigemptyset (&nvar); \
46 sigaddset (&nvar, sig); \
47 sigemptyset (&ovar); \
48 sigprocmask (SIG_BLOCK, &nvar, &ovar); \
49 } \
50 while (0)
51
52 #if defined (HAVE_POSIX_SIGNALS)
53 #define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
54 #define UNBLOCK_CHILD(ovar) sigprocmask (SIG_SETMASK, &ovar, 0)
55 #else
56 #define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD))
57 #define UNBLOCK_CHILD(ovar) sigsetmask (ovar)
38 #endif 58 #endif
39 59
40 typedef RETSIGTYPE sig_handler (int); 60 typedef RETSIGTYPE sig_handler (int);
41 61
42 // All we need to do is declare pointers to this, so we don't need to 62 // All we need to do is declare pointers to this, so we don't need to