2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
12 * $Id: signal.h,v 1.16 2001/07/20 19:48:21 gshapiro Exp $
16 ** SIGNAL.H -- libsm (and sendmail) signal facilities
17 ** Extracted from sendmail/conf.h and focusing
18 ** on signal configuration.
24 #include <sys/types.h>
31 ** Critical signal sections
34 #define PEND_SIGHUP 0x0001
35 #define PEND_SIGINT 0x0002
36 #define PEND_SIGTERM 0x0004
37 #define PEND_SIGUSR1 0x0008
39 #define ENTER_CRITICAL() InCriticalSection++
41 #define LEAVE_CRITICAL() \
44 if (InCriticalSection > 0) \
45 InCriticalSection--; \
48 #define CHECK_CRITICAL(sig) \
51 if (InCriticalSection > 0 && (sig) != 0) \
54 return SIGFUNC_RETURN; \
59 extern unsigned int volatile InCriticalSection
; /* >0 if in critical section */
60 extern int volatile PendingSignal
; /* pending signal to resend */
63 extern void pend_signal
__P((int));
65 /* reset signal in case System V semantics */
67 # define FIX_SYSV_SIGNAL(sig, handler) \
70 (void) sm_signal((sig), (handler)); \
72 #else /* SYS5SIGNALS */
73 # define FIX_SYSV_SIGNAL(sig, handler) { /* EMPTY */ }
74 #endif /* SYS5SIGNALS */
76 extern void sm_allsignals
__P((bool));
77 extern int sm_blocksignal
__P((int));
78 extern int sm_releasesignal
__P((int));
79 extern sigfunc_t sm_signal
__P((int, sigfunc_t
));
80 extern SIGFUNC_DECL sm_signal_noop
__P((int));
81 #endif /* SM_SIGNAL_H */