Stop supporting longjmperror(); it's not used, not portable, and the checks
longjmp performs can't really be relied upon, even after we got rid of the
false positives...
···11-.\" $OpenBSD: setjmp.3,v 1.24 2013/07/17 05:42:11 schwarze Exp $
11+.\" $OpenBSD: setjmp.3,v 1.25 2016/05/23 00:18:56 guenther Exp $
22.\"
33.\" Copyright (c) 1990, 1991, 1993
44.\" The Regents of the University of California. All rights reserved.
···3131.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3232.\" SUCH DAMAGE.
3333.\"
3434-.Dd $Mdocdate: July 17 2013 $
3434+.Dd $Mdocdate: May 23 2016 $
3535.Dt SETJMP 3
3636.Os
3737.Sh NAME
···4040.Nm setjmp ,
4141.Nm longjmp ,
4242.Nm _setjmp ,
4343-.Nm _longjmp ,
4444-.Nm longjmperror
4343+.Nm _longjmp
4544.Nd non-local jumps
4645.Sh SYNOPSIS
4746.In setjmp.h
···5756.Fn _setjmp "jmp_buf env"
5857.Ft void
5958.Fn _longjmp "jmp_buf env" "int val"
6060-.Ft void
6161-.Fn longjmperror void
6259.Sh DESCRIPTION
6360The
6461.Fn sigsetjmp ,
···127124function pairs save and restore the signal mask while the
128125.Fn _setjmp Ns / Ns Fn _longjmp
129126function pairs save and restore only the register set and the stack (see
130130-.Xr sigmask 3 ) .
127127+.Xr sigprocmask 2 ) .
131128.Pp
132129The
133130.Fn sigsetjmp Ns / Ns Fn siglongjmp
···157154The
158155.Fn sigsetjmp Ns / Ns Fn siglongjmp
159156interfaces are preferred for maximum portability.
160160-.Sh ERRORS
161161-If the contents of the
162162-.Fa env
163163-are corrupted or correspond to an environment that has already returned,
164164-the
165165-.Fn longjmp
166166-routine calls the routine
167167-.Xr longjmperror 3 .
168168-If
169169-.Fn longjmperror
170170-returns, the program is aborted (see
171171-.Xr abort 3 ) .
172172-The default version of
173173-.Fn longjmperror
174174-prints the message
175175-.Dq Li longjmp botch
176176-to standard error and returns.
177177-User programs wishing to exit more gracefully should write their own
178178-versions of
179179-.Fn longjmperror .
180157.Sh SEE ALSO
181181-.Xr sigaction 2 ,
182182-.Xr sigaltstack 2 ,
183183-.Xr signal 3
158158+.Xr sigprocmask 2
184159.Sh STANDARDS
185160The
186161.Fn setjmp
-46
lib/libc/gen/setjmperr.c
···11-/* $OpenBSD: setjmperr.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
22-/*
33- * Copyright (c) 1980, 1993
44- * The Regents of the University of California. All rights reserved.
55- *
66- * Redistribution and use in source and binary forms, with or without
77- * modification, are permitted provided that the following conditions
88- * are met:
99- * 1. Redistributions of source code must retain the above copyright
1010- * notice, this list of conditions and the following disclaimer.
1111- * 2. Redistributions in binary form must reproduce the above copyright
1212- * notice, this list of conditions and the following disclaimer in the
1313- * documentation and/or other materials provided with the distribution.
1414- * 3. Neither the name of the University nor the names of its contributors
1515- * may be used to endorse or promote products derived from this software
1616- * without specific prior written permission.
1717- *
1818- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1919- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2020- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2121- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2222- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2323- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2424- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2525- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2626- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2727- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2828- * SUCH DAMAGE.
2929- */
3030-3131-/*
3232- * This routine is called from longjmp() when an error occurs.
3333- * Programs that wish to exit gracefully from this error may
3434- * write their own versions.
3535- * If this routine returns, the program is aborted.
3636- */
3737-3838-#include <setjmp.h>
3939-#include <unistd.h>
4040-4141-void
4242-longjmperror(void)
4343-{
4444-#define ERRMSG "longjmp botch.\n"
4545- (void)write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1);
4646-}