Mercurial > emacs
comparison src/syssignal.h @ 20949:292cd2a2d600
(sigmask) [POSIX_SIGNALS]: Always define our own
version that returns a sigset_t.
(sigpause) [POSIX_SIGNALS]: Unconditionally define in terms of
sigsuspend. Don't redefine SIGEMPTYMASK.
(sys_sigpause): Don't declare.
(temp_mask): Don't declare.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Fri, 20 Feb 1998 13:01:10 +0000 |
parents | c91e58230454 |
children | ba03aa5d64d6 |
comparison
equal
deleted
inserted
replaced
20948:a9a9a13079b4 | 20949:292cd2a2d600 |
---|---|
28 | 28 |
29 #define SIGMASKTYPE sigset_t | 29 #define SIGMASKTYPE sigset_t |
30 | 30 |
31 #define SIGEMPTYMASK (empty_mask) | 31 #define SIGEMPTYMASK (empty_mask) |
32 #define SIGFULLMASK (full_mask) | 32 #define SIGFULLMASK (full_mask) |
33 extern sigset_t empty_mask, full_mask, temp_mask; | 33 extern sigset_t empty_mask, full_mask; |
34 | 34 |
35 /* POSIX pretty much destroys any possibility of writing sigmask as a | 35 /* POSIX pretty much destroys any possibility of writing sigmask as a |
36 macro in standard C. */ | 36 macro in standard C. We always define our own version because the |
37 #ifndef sigmask | 37 predefined macro in Glibc 2.1 is only provided for compatility for old |
38 programs that use int as signal mask type. */ | |
39 #undef sigmask | |
38 #ifdef __GNUC__ | 40 #ifdef __GNUC__ |
39 #define sigmask(SIG) \ | 41 #define sigmask(SIG) \ |
40 ({ \ | 42 ({ \ |
41 sigset_t _mask; \ | 43 sigset_t _mask; \ |
42 sigemptyset (&_mask); \ | 44 sigemptyset (&_mask); \ |
47 extern sigset_t sys_sigmask (); | 49 extern sigset_t sys_sigmask (); |
48 #define sigmask(SIG) (sys_sigmask (SIG)) | 50 #define sigmask(SIG) (sys_sigmask (SIG)) |
49 #endif /* ! defined (__GNUC__) */ | 51 #endif /* ! defined (__GNUC__) */ |
50 #endif | 52 #endif |
51 | 53 |
52 #ifndef sigpause | 54 #undef sigpause |
53 #define sigpause(SIG) sys_sigpause (SIG) | 55 #define sigpause(MASK) sigsuspend (&(MASK)) |
54 #else | |
55 /* If sigpause is predefined, with POSIX_SIGNALS, | |
56 let's assume it needs this kind of argument. | |
57 This is true for Glibc 2.1. */ | |
58 #undef SIGEMPTYMASK | |
59 #define SIGEMPTYMASK sigmask (0) | |
60 #endif | |
61 | 56 |
62 #define sigblock(SIG) sys_sigblock (SIG) | 57 #define sigblock(SIG) sys_sigblock (SIG) |
63 #define sigunblock(SIG) sys_sigunblock (SIG) | 58 #define sigunblock(SIG) sys_sigunblock (SIG) |
64 #ifndef sigsetmask | 59 #ifndef sigsetmask |
65 #define sigsetmask(SIG) sys_sigsetmask (SIG) | 60 #define sigsetmask(SIG) sys_sigsetmask (SIG) |
72 /* Whether this is what all systems want or not, this is what | 67 /* Whether this is what all systems want or not, this is what |
73 appears to be assumed in the source, for example data.c:arith_error. */ | 68 appears to be assumed in the source, for example data.c:arith_error. */ |
74 typedef RETSIGTYPE (*signal_handler_t) (/*int*/); | 69 typedef RETSIGTYPE (*signal_handler_t) (/*int*/); |
75 | 70 |
76 signal_handler_t sys_signal (/*int signal_number, signal_handler_t action*/); | 71 signal_handler_t sys_signal (/*int signal_number, signal_handler_t action*/); |
77 int sys_sigpause (/*sigset_t new_mask*/); | |
78 sigset_t sys_sigblock (/*sigset_t new_mask*/); | 72 sigset_t sys_sigblock (/*sigset_t new_mask*/); |
79 sigset_t sys_sigunblock (/*sigset_t new_mask*/); | 73 sigset_t sys_sigunblock (/*sigset_t new_mask*/); |
80 sigset_t sys_sigsetmask (/*sigset_t new_mask*/); | 74 sigset_t sys_sigsetmask (/*sigset_t new_mask*/); |
81 | 75 |
82 #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) | 76 #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) |