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 $
15 #pragma ident "%Z%%M% %I% %E% SMI"
18 ** SIGNAL.H -- libsm (and sendmail) signal facilities
19 ** Extracted from sendmail/conf.h and focusing
20 ** on signal configuration.
26 #include <sys/types.h>
33 ** Critical signal sections
36 #define PEND_SIGHUP 0x0001
37 #define PEND_SIGINT 0x0002
38 #define PEND_SIGTERM 0x0004
39 #define PEND_SIGUSR1 0x0008
41 #define ENTER_CRITICAL() InCriticalSection++
43 #define LEAVE_CRITICAL() \
46 if (InCriticalSection > 0) \
47 InCriticalSection--; \
50 #define CHECK_CRITICAL(sig) \
53 if (InCriticalSection > 0 && (sig) != 0) \
56 return SIGFUNC_RETURN; \
61 extern unsigned int volatile InCriticalSection
; /* >0 if in critical section */
62 extern int volatile PendingSignal
; /* pending signal to resend */
65 extern void pend_signal
__P((int));
67 /* reset signal in case System V semantics */
69 # define FIX_SYSV_SIGNAL(sig, handler) \
72 (void) sm_signal((sig), (handler)); \
74 #else /* SYS5SIGNALS */
75 # define FIX_SYSV_SIGNAL(sig, handler) { /* EMPTY */ }
76 #endif /* SYS5SIGNALS */
78 extern void sm_allsignals
__P((bool));
79 extern int sm_blocksignal
__P((int));
80 extern int sm_releasesignal
__P((int));
81 extern sigfunc_t sm_signal
__P((int, sigfunc_t
));
82 extern SIGFUNC_DECL sm_signal_noop
__P((int));
83 #endif /* SM_SIGNAL_H */