]>
code.delx.au - gnu-emacs/blob - src/syssignal.h
486f9efd623febc3ac2add8b476f2f1b062d3bbc
1 /* syssignal.h - System-dependent definitions for signals.
2 Copyright (C) 1992 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #define SIGMASKTYPE sigset_t
23 #define SIGEMPTYMASK (empty_mask)
24 #define SIGFULLMASK (full_mask)
25 extern sigset_t empty_mask
, full_mask
, temp_mask
;
27 /* POSIX pretty much destroys any possibility of writing sigmask as a
28 macro in standard C. */
30 #define sigmask(SIG) \
33 sigemptyset (&_mask); \
34 sigaddset (&_mask, SIG); \
38 #define sigmask(SIG) (sys_sigmask (SIG))
41 #define sigpause(SIG) sys_sigpause(SIG)
42 #define sigblock(SIG) sys_sigblock(SIG)
43 #define sigunblock(SIG) sys_sigunblock(SIG)
44 #define sigsetmask(SIG) sys_sigsetmask(SIG)
45 #define sighold(SIG) ONLY_USED_IN_BSD_4_1
46 #define sigrelse(SIG) ONLY_USED_IN_BSD_4_1
48 int (*sys_signal (int signal_number
, int (*action
)())) ();
49 int sys_sigpause (int signal_number
);
50 sigset_t
sys_sigblock (sigset_t new_mask
);
51 sigset_t
sys_sigunblock (sigset_t new_mask
);
52 sigset_t
sys_sigsetmask (sigset_t new_mask
);
54 #define sys_sigdel(MASK,SIG) sigdelset(&MASK,SIG)
56 #else /* not POSIX_SIGNALS */
58 #define sigunblock(SIG) \
59 { SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); }
61 #endif /* not POSIX_SIGNALS */
64 #define SIGMASKTYPE int
68 #define SIGEMPTYMASK (0)
72 #define SIGFULLMASK (0xffffffff)
76 #define sigmask(no) (1L << ((no) - 1))
80 #define sigunblock(SIG) \
81 { SIGMASKTYPE omask = sigblock (SIGFULLMASK); sigsetmask (omask & ~SIG); }
84 /* It would be very nice if we could somehow clean up all this trash. */
87 #define sigfree() sigsetmask (SIGEMPTYMASK)
88 #define sigholdx(sig) sigsetmask (sigmask (sig))
89 #define sigblockx(sig) sigblock (sigmask (sig))
90 #define sigunblockx(sig) sigblock (SIGEMPTYMASK)
91 #define sigpausex(sig) sigpause (0)
92 #endif /* not BSD4_1 */
96 /* sigfree and sigholdx are in sysdep.c */
97 #define sigblockx(sig) sighold (sig)
98 #define sigunblockx(sig) sigrelse (sig)
99 #define sigpausex(sig) sigpause (sig)
102 /* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
103 Must do that using the killpg call. */
105 #define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo)))
107 #define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo)))
110 /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals
115 #define SIGCHLD SIGCLD
116 #endif /* not SIGCHLD */