Update zoneinfo database.
[dragonfly/netmp.git] / contrib / sendmail / include / sm / signal.h
blob3821deb2bb6233de52d0f6c9176ba3116ebfac5d
1 /*
2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
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.
21 #ifndef SM_SIGNAL_H
22 #define SM_SIGNAL_H 1
24 #include <sys/types.h>
25 #include <limits.h>
26 #include <signal.h>
27 #include <sm/cdefs.h>
28 #include <sm/conf.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() \
42 do \
43 { \
44 if (InCriticalSection > 0) \
45 InCriticalSection--; \
46 } while (0)
48 #define CHECK_CRITICAL(sig) \
49 do \
50 { \
51 if (InCriticalSection > 0 && (sig) != 0) \
52 { \
53 pend_signal((sig)); \
54 return SIGFUNC_RETURN; \
55 } \
56 } while (0)
58 /* variables */
59 extern unsigned int volatile InCriticalSection; /* >0 if in critical section */
60 extern int volatile PendingSignal; /* pending signal to resend */
62 /* functions */
63 extern void pend_signal __P((int));
65 /* reset signal in case System V semantics */
66 #ifdef SYS5SIGNALS
67 # define FIX_SYSV_SIGNAL(sig, handler) \
68 { \
69 if ((sig) != 0) \
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 */