diff options
-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. |