2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
9 * $Id: setjmp.h,v 1.3 2001/03/08 03:23:08 ca Exp $
12 #pragma ident "%Z%%M% %I% %E% SMI"
17 # include <sm/config.h>
21 ** sm_setjmp_sig is a setjmp that saves the signal mask.
22 ** sm_setjmp_nosig is a setjmp that does *not* save the signal mask.
23 ** SM_JMPBUF_T is used with both of the above macros.
25 ** On most systems, these can be implemented using sigsetjmp.
26 ** Some old BSD systems do not have sigsetjmp, but they do have
27 ** setjmp and _setjmp, which are just as good.
30 # if SM_CONF_SIGSETJMP
32 typedef sigjmp_buf SM_JMPBUF_T
;
33 # define sm_setjmp_sig(buf) sigsetjmp(buf, 1)
34 # define sm_setjmp_nosig(buf) sigsetjmp(buf, 0)
35 # define sm_longjmp_sig(buf, val) siglongjmp(buf, val)
36 # define sm_longjmp_nosig(buf, val) siglongjmp(buf, val)
38 # else /* SM_CONF_SIGSETJMP */
40 typedef jmp_buf SM_JMPBUF_T
;
41 # define sm_setjmp_sig(buf) setjmp(buf)
42 # define sm_longjmp_sig(buf, val) longjmp(buf, val)
43 # define sm_setjmp_nosig(buf) _setjmp(buf)
44 # define sm_longjmp_nosig(buf, val) _longjmp(buf, val)
46 # endif /* SM_CONF_SIGSETJMP */
48 #endif /* ! SM_SETJMP_H */