diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-12 21:28:20 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-12 21:28:20 +0000 |
commit | 6f5736c45aae3a2e0226284352d865283e5f7d69 (patch) | |
tree | fad8c2736ead1c50296027c3fe9ede43d6b06d98 | |
parent | 7315dfdd6fe1d0ab33874e0377dac8cf29cfa117 (diff) |
Clarify sigsetjmp vs. setjmp vs. _setjmp.
-rw-r--r-- | lib/libc/gen/setjmp.3 | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/libc/gen/setjmp.3 b/lib/libc/gen/setjmp.3 index 33ceb09bcaf..bf27c5ff991 100644 --- a/lib/libc/gen/setjmp.3 +++ b/lib/libc/gen/setjmp.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: setjmp.3,v 1.11 2000/12/24 00:30:51 aaron Exp $ +.\" $OpenBSD: setjmp.3,v 1.12 2001/01/12 21:28:19 millert Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -132,6 +132,28 @@ function pairs save and restore the signal mask if the argument .Fa savemask is non-zero. Otherwise, only the register set and the stack are saved. +.Pp +In other words, +.Fn setjmp Ns / Ns Fn longjmp +are functionally equivalent to +.Fn sigsetjmp Ns / Ns Fn siglongjmp +when +.Fn sigsetjmp +is called with a non-zero +.Fa savemask +argument. +Conversely, +.Fn _setjmp Ns / Ns Fn _longjmp +are functionally equivalent to +.Fn sigsetjmp Ns / Ns Fn siglongjmp +when +.Fn sigsetjmp +is called with a zero-value +.Fa savemask . +.Pp +The +.Fn sigsetjmp Ns / Ns Fn siglongjmp +interfaces are preferred for maximum portability. .Sh ERRORS If the contents of the .Fa env @@ -169,3 +191,15 @@ and .Fn siglongjmp functions conform to .St -p1003.1-90 . +.Sh CAVEATS +Historically, on +.At V , +the +.Fn setjmp Ns / Ns Fn longjmp +functions have been equivalent to the +.Bx +.Fn _setjmp Ns / Ns Fn _longjmp +functions and do not restore the signal mask. +Because of this discrepancy, the +.Fn sigsetjmp Ns / Ns Fn siglongjmp +interfaces should be used if portability is desired. |