summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/include/sm/setjmp.h
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-02-17 21:56:45 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-02-17 21:56:45 +0000
commit8449595fe97f4474b9b9a7e4edee1ef35dcff393 (patch)
treee7a33b132264d449a512ddf4a8685df097669c1d /contrib/sendmail/include/sm/setjmp.h
parent289b381b31415647269c7520d881017e2dcb27f1 (diff)
downloadFreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.zip
FreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.tar.gz
Import sendmail 8.12.2
Diffstat (limited to 'contrib/sendmail/include/sm/setjmp.h')
-rw-r--r--contrib/sendmail/include/sm/setjmp.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/contrib/sendmail/include/sm/setjmp.h b/contrib/sendmail/include/sm/setjmp.h
new file mode 100644
index 0000000..01bda02
--- /dev/null
+++ b/contrib/sendmail/include/sm/setjmp.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ * $Id: setjmp.h,v 1.3 2001/03/08 03:23:08 ca Exp $
+ */
+
+#ifndef SM_SETJMP_H
+# define SM_SETJMP_H
+
+# include <sm/config.h>
+# include <setjmp.h>
+
+/*
+** sm_setjmp_sig is a setjmp that saves the signal mask.
+** sm_setjmp_nosig is a setjmp that does *not* save the signal mask.
+** SM_JMPBUF_T is used with both of the above macros.
+**
+** On most systems, these can be implemented using sigsetjmp.
+** Some old BSD systems do not have sigsetjmp, but they do have
+** setjmp and _setjmp, which are just as good.
+*/
+
+# if SM_CONF_SIGSETJMP
+
+typedef sigjmp_buf SM_JMPBUF_T;
+# define sm_setjmp_sig(buf) sigsetjmp(buf, 1)
+# define sm_setjmp_nosig(buf) sigsetjmp(buf, 0)
+# define sm_longjmp_sig(buf, val) siglongjmp(buf, val)
+# define sm_longjmp_nosig(buf, val) siglongjmp(buf, val)
+
+# else /* SM_CONF_SIGSETJMP */
+
+typedef jmp_buf SM_JMPBUF_T;
+# define sm_setjmp_sig(buf) setjmp(buf)
+# define sm_longjmp_sig(buf, val) longjmp(buf, val)
+# define sm_setjmp_nosig(buf) _setjmp(buf)
+# define sm_longjmp_nosig(buf, val) _longjmp(buf, val)
+
+# endif /* SM_CONF_SIGSETJMP */
+
+#endif /* ! SM_SETJMP_H */
OpenPOWER on IntegriCloud