1N/A/*
1N/A * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
1N/A * All rights reserved.
1N/A *
1N/A * By using this file, you agree to the terms and conditions set
1N/A * forth in the LICENSE file which can be found at the top level of
1N/A * the sendmail distribution.
1N/A *
1N/A * $Id: setjmp.h,v 1.3 2001/03/08 03:23:08 ca Exp $
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#ifndef SM_SETJMP_H
1N/A# define SM_SETJMP_H
1N/A
1N/A# include <sm/config.h>
1N/A# include <setjmp.h>
1N/A
1N/A/*
1N/A** sm_setjmp_sig is a setjmp that saves the signal mask.
1N/A** sm_setjmp_nosig is a setjmp that does *not* save the signal mask.
1N/A** SM_JMPBUF_T is used with both of the above macros.
1N/A**
1N/A** On most systems, these can be implemented using sigsetjmp.
1N/A** Some old BSD systems do not have sigsetjmp, but they do have
1N/A** setjmp and _setjmp, which are just as good.
1N/A*/
1N/A
1N/A# if SM_CONF_SIGSETJMP
1N/A
1N/Atypedef sigjmp_buf SM_JMPBUF_T;
1N/A# define sm_setjmp_sig(buf) sigsetjmp(buf, 1)
1N/A# define sm_setjmp_nosig(buf) sigsetjmp(buf, 0)
1N/A# define sm_longjmp_sig(buf, val) siglongjmp(buf, val)
1N/A# define sm_longjmp_nosig(buf, val) siglongjmp(buf, val)
1N/A
1N/A# else /* SM_CONF_SIGSETJMP */
1N/A
1N/Atypedef jmp_buf SM_JMPBUF_T;
1N/A# define sm_setjmp_sig(buf) setjmp(buf)
1N/A# define sm_longjmp_sig(buf, val) longjmp(buf, val)
1N/A# define sm_setjmp_nosig(buf) _setjmp(buf)
1N/A# define sm_longjmp_nosig(buf, val) _longjmp(buf, val)
1N/A
1N/A# endif /* SM_CONF_SIGSETJMP */
1N/A
1N/A#endif /* ! SM_SETJMP_H */