aboutsummaryrefslogtreecommitdiff
path: root/setjmp
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
committerZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
commit5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch)
tree4470480d904b65cf14ca524f96f79eca818c3eaf /setjmp
parent199fc19d3aaaf57944ef036e15904febe877fc93 (diff)
downloadglibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar
glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.gz
glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.bz2
glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.zip
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage directory, REORG.TODO, except for files that will certainly still exist in their current form at top level when we're done (COPYING, COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which are moved to the new directory OldChangeLogs, instead), and the generated file INSTALL (which is just deleted; in the new order, there will be no generated files checked into version control).
Diffstat (limited to 'setjmp')
-rw-r--r--setjmp/Makefile37
-rw-r--r--setjmp/Versions16
-rw-r--r--setjmp/__longjmp.c34
-rw-r--r--setjmp/bits/setjmp2.h40
-rw-r--r--setjmp/bsd-_setjmp.c34
-rw-r--r--setjmp/bsd-setjmp.c33
-rw-r--r--setjmp/bug269-setjmp.c106
-rw-r--r--setjmp/jmp-unwind.c28
-rw-r--r--setjmp/jmpbug.c41
-rw-r--r--setjmp/longjmp.c47
-rw-r--r--setjmp/setjmp.c35
-rw-r--r--setjmp/setjmp.h105
-rw-r--r--setjmp/sigjmp.c34
-rw-r--r--setjmp/tst-setjmp-fp.c105
-rw-r--r--setjmp/tst-setjmp-static.c1
-rw-r--r--setjmp/tst-setjmp.c120
-rw-r--r--setjmp/tst-sigsetjmp.c44
17 files changed, 0 insertions, 860 deletions
diff --git a/setjmp/Makefile b/setjmp/Makefile
deleted file mode 100644
index ca80b8ea13..0000000000
--- a/setjmp/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 1991-2017 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-#
-# Makefile for setjmp/longjmp routines
-#
-subdir := setjmp
-
-include ../Makeconfig
-
-headers := setjmp.h bits/setjmp.h bits/setjmp2.h
-
-routines := setjmp sigjmp bsd-setjmp bsd-_setjmp \
- longjmp __longjmp jmp-unwind
-
-tests := tst-setjmp jmpbug bug269-setjmp tst-setjmp-fp \
- tst-sigsetjmp tst-setjmp-static
-tests-static := tst-setjmp-static
-
-
-include ../Rules
-
-$(objpfx)tst-setjmp-fp: $(libm)
diff --git a/setjmp/Versions b/setjmp/Versions
deleted file mode 100644
index 2baa49ae8a..0000000000
--- a/setjmp/Versions
+++ /dev/null
@@ -1,16 +0,0 @@
-libc {
- GLIBC_2.0 {
- # functions with special/multiple interfaces
- _longjmp; __sigsetjmp; _setjmp;
-
- # l*
- longjmp;
-
- # s*
- setjmp;
- }
- GLIBC_PRIVATE {
- # helper functions
- __libc_longjmp; __libc_siglongjmp;
- }
-}
diff --git a/setjmp/__longjmp.c b/setjmp/__longjmp.c
deleted file mode 100644
index 72b27b6aa3..0000000000
--- a/setjmp/__longjmp.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <setjmp.h>
-
-
-/* Jump to the position specified by ENV, causing the
- setjmp call there to return VAL, or 1 if VAL is 0. */
-void
-__longjmp (__jmp_buf env, int val)
-{
- if (val == 0)
- val = 1;
-
- __set_errno (ENOSYS);
- /* No way to signal failure. */
-}
-
-stub_warning (longjmp)
diff --git a/setjmp/bits/setjmp2.h b/setjmp/bits/setjmp2.h
deleted file mode 100644
index 83dc006774..0000000000
--- a/setjmp/bits/setjmp2.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Checking macros for setjmp functions.
- Copyright (C) 2009-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SETJMP_H
-# error "Never include <bits/setjmp2.h> directly; use <setjmp.h> instead."
-#endif
-
-/* Variant of the longjmp functions which perform some sanity checking. */
-#ifdef __REDIRECT_NTH
-extern void __REDIRECT_NTHNL (longjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
-extern void __REDIRECT_NTHNL (_longjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
-extern void __REDIRECT_NTHNL (siglongjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
-#else
-extern void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val),
- __THROWNL __attribute__ ((__noreturn__));
-# define longjmp __longjmp_chk
-# define _longjmp __longjmp_chk
-# define siglongjmp __longjmp_chk
-#endif
diff --git a/setjmp/bsd-_setjmp.c b/setjmp/bsd-_setjmp.c
deleted file mode 100644
index cf5963cf49..0000000000
--- a/setjmp/bsd-_setjmp.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Stub version.
- Copyright (C) 1994-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <setjmp.h>
-
-#undef _setjmp
-
-/* This implementation in C will not usually work, because the call
- really needs to be a tail-call so __sigsetjmp saves the state of
- the caller, not the state of this `setjmp' frame which then
- immediate unwinds. */
-
-int
-_setjmp (jmp_buf env)
-{
- return __sigsetjmp (env, 0);
-}
-libc_hidden_def (_setjmp)
diff --git a/setjmp/bsd-setjmp.c b/setjmp/bsd-setjmp.c
deleted file mode 100644
index e2a6e51602..0000000000
--- a/setjmp/bsd-setjmp.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Stub version.
- Copyright (C) 1994-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <setjmp.h>
-
-#undef setjmp
-
-/* This implementation in C will not usually work, because the call
- really needs to be a tail-call so __sigsetjmp saves the state of
- the caller, not the state of this `setjmp' frame which then
- immediate unwinds. */
-
-int
-setjmp (jmp_buf env)
-{
- return __sigsetjmp (env, 1);
-}
diff --git a/setjmp/bug269-setjmp.c b/setjmp/bug269-setjmp.c
deleted file mode 100644
index 3d1a73776c..0000000000
--- a/setjmp/bug269-setjmp.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Copyright (C) 2004-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Test case for Bugzilla # 269 */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <stdlib.h>
-
-jmp_buf buf1;
-jmp_buf buf2;
-int *p;
-int n_x = 6;
-
-static int g_counter = 0;
-
-int
-f (void)
-{
- static int counter = 0;
- static int way_point1 = 3;
- static int way_point2 = 2;
- int lose = 0;
-
- if (setjmp (buf1) != 101)
- {
- int a[n_x]; /* reallocate stack space */
- g_counter++;
- p = &a[0];
- if (g_counter < 5)
- longjmp (buf1, 2);
- else if (g_counter == 5)
- longjmp (buf1, 101);
- else
- {
- _setjmp (buf2);
- _longjmp (buf1, 101);
- }
- }
-
- way_point1--;
-
- if (counter == 0)
- {
- counter++;
- {
- int a[n_x]; /* reallocate stack space */
- g_counter++;
- p = &a[0];
- if (g_counter < 5)
- longjmp (buf1, 2);
- else if (g_counter == 5)
- longjmp (buf1, 101);
- else
- {
- _setjmp (buf2);
- _longjmp (buf1, 101);
- }
- }
- }
-
- way_point2--;
-
- if (counter == 1)
- {
- counter++;
- longjmp (buf2, 2);
- }
-
- lose = !(way_point1 == 0 && way_point2 == 0
- && g_counter == 6 && counter == 2);
-
- return lose;
-}
-
-static int
-do_test (void)
-{
- int lose;
-
- lose = f ();
-
- if (lose)
- puts ("Test FAILED!");
- else
- puts ("Test succeeded!");
-
- return lose ? EXIT_FAILURE : EXIT_SUCCESS;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/setjmp/jmp-unwind.c b/setjmp/jmp-unwind.c
deleted file mode 100644
index a43db84b9d..0000000000
--- a/setjmp/jmp-unwind.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* _longjmp_unwind -- Clean up stack frames unwound by longjmp. Stub version.
- Copyright (C) 1995-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-
-void
-_longjmp_unwind (jmp_buf env, int val)
-{
-
- /* This function can perform any cleanups necessary to safely unwind the
- stack frames around the current context which ENV unwinds past. */
-
-}
diff --git a/setjmp/jmpbug.c b/setjmp/jmpbug.c
deleted file mode 100644
index 8594c5a8a7..0000000000
--- a/setjmp/jmpbug.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* setjmp vs alloca test case. Exercised bug on sparc. */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <alloca.h>
-
-static void
-sub5 (jmp_buf buf)
-{
- longjmp (buf, 1);
-}
-
-static void
-test (int x)
-{
- jmp_buf buf;
- char *volatile foo;
- int arr[100];
-
- arr[77] = x;
- if (setjmp (buf))
- {
- printf ("made it ok; %d\n", arr[77]);
- return;
- }
-
- foo = (char *) alloca (128);
- (void) foo;
- sub5 (buf);
-}
-
-int
-main (void)
-{
- int i;
-
- for (i = 123; i < 345; ++i)
- test (i);
-
- return 0;
-}
diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c
deleted file mode 100644
index 2453c2c124..0000000000
--- a/setjmp/longjmp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <stddef.h>
-#include <setjmp.h>
-#include <signal.h>
-
-
-/* Set the signal mask to the one specified in ENV, and jump
- to the position specified in ENV, causing the setjmp
- call there to return VAL, or 1 if VAL is 0. */
-void
-__libc_siglongjmp (sigjmp_buf env, int val)
-{
- /* Perform any cleanups needed by the frames being unwound. */
- _longjmp_unwind (env, val);
-
- if (env[0].__mask_was_saved)
- /* Restore the saved signal mask. */
- (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
- (sigset_t *) NULL);
-
- /* Call the machine-dependent function to restore machine state. */
- __longjmp (env[0].__jmpbuf, val ?: 1);
-}
-
-#ifndef __libc_siglongjmp
-strong_alias (__libc_siglongjmp, __libc_longjmp)
-libc_hidden_def (__libc_longjmp)
-weak_alias (__libc_siglongjmp, _longjmp)
-weak_alias (__libc_siglongjmp, longjmp)
-weak_alias (__libc_siglongjmp, siglongjmp)
-#endif
diff --git a/setjmp/setjmp.c b/setjmp/setjmp.c
deleted file mode 100644
index 375e10f375..0000000000
--- a/setjmp/setjmp.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <setjmp.h>
-
-
-/* Save the current program position in ENV and return 0. */
-int
-__libc_sigsetjmp (jmp_buf env, int savemask)
-{
- /* Save the signal mask if requested. */
- __sigjmp_save (env, savemask);
-
- __set_errno (ENOSYS);
- /* No way to signal failure. */
- return 0;
-}
-
-weak_alias (__libc_sigsetjmp, __sigsetjmp)
-stub_warning (__sigsetjmp)
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
deleted file mode 100644
index 86fb2edf6c..0000000000
--- a/setjmp/setjmp.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/*
- * ISO C99 Standard: 7.13 Nonlocal jumps <setjmp.h>
- */
-
-#ifndef _SETJMP_H
-#define _SETJMP_H 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-#include <bits/setjmp.h> /* Get `__jmp_buf'. */
-#include <bits/types/__sigset_t.h>
-
-/* Calling environment, plus possibly a saved signal mask. */
-struct __jmp_buf_tag
- {
- /* NOTE: The machine-dependent definitions of `__sigsetjmp'
- assume that a `jmp_buf' begins with a `__jmp_buf' and that
- `__mask_was_saved' follows it. Do not move these members
- or add others before it. */
- __jmp_buf __jmpbuf; /* Calling environment. */
- int __mask_was_saved; /* Saved the signal mask? */
- __sigset_t __saved_mask; /* Saved signal mask. */
- };
-
-
-typedef struct __jmp_buf_tag jmp_buf[1];
-
-/* Store the calling environment in ENV, also saving the signal mask.
- Return 0. */
-extern int setjmp (jmp_buf __env) __THROWNL;
-
-/* Store the calling environment in ENV, also saving the
- signal mask if SAVEMASK is nonzero. Return 0.
- This is the internal name for `sigsetjmp'. */
-extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
-
-/* Store the calling environment in ENV, not saving the signal mask.
- Return 0. */
-extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL;
-
-/* Do not save the signal mask. This is equivalent to the `_setjmp'
- BSD function. */
-#define setjmp(env) _setjmp (env)
-
-
-/* Jump to the environment saved in ENV, making the
- `setjmp' call there return VAL, or 1 if VAL is 0. */
-extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROWNL __attribute__ ((__noreturn__));
-
-#if defined __USE_MISC || defined __USE_XOPEN
-/* Same. Usually `_longjmp' is used with `_setjmp', which does not save
- the signal mask. But it is how ENV was saved that determines whether
- `longjmp' restores the mask; `_longjmp' is just an alias. */
-extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROWNL __attribute__ ((__noreturn__));
-#endif
-
-
-#ifdef __USE_POSIX
-/* Use the same type for `jmp_buf' and `sigjmp_buf'.
- The `__mask_was_saved' flag determines whether
- or not `longjmp' will restore the signal mask. */
-typedef struct __jmp_buf_tag sigjmp_buf[1];
-
-/* Store the calling environment in ENV, also saving the
- signal mask if SAVEMASK is nonzero. Return 0. */
-# define sigsetjmp(env, savemask) __sigsetjmp (env, savemask)
-
-/* Jump to the environment saved in ENV, making the
- sigsetjmp call there return VAL, or 1 if VAL is 0.
- Restore the signal mask if that sigsetjmp call saved it.
- This is just an alias `longjmp'. */
-extern void siglongjmp (sigjmp_buf __env, int __val)
- __THROWNL __attribute__ ((__noreturn__));
-#endif /* Use POSIX. */
-
-
-/* Define helper functions to catch unsafe code. */
-#if __USE_FORTIFY_LEVEL > 0
-# include <bits/setjmp2.h>
-#endif
-
-__END_DECLS
-
-#endif /* setjmp.h */
diff --git a/setjmp/sigjmp.c b/setjmp/sigjmp.c
deleted file mode 100644
index 30839ae819..0000000000
--- a/setjmp/sigjmp.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1992-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <stddef.h>
-#include <setjmp.h>
-#include <signal.h>
-
-/* This function is called by the `sigsetjmp' macro
- before doing a `__setjmp' on ENV[0].__jmpbuf.
- Always return zero. */
-
-int
-__sigjmp_save (sigjmp_buf env, int savemask)
-{
- env[0].__mask_was_saved = (savemask &&
- __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
- &env[0].__saved_mask) == 0);
-
- return 0;
-}
diff --git a/setjmp/tst-setjmp-fp.c b/setjmp/tst-setjmp-fp.c
deleted file mode 100644
index 99a9cbb5a3..0000000000
--- a/setjmp/tst-setjmp-fp.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Test that setjmp/longjmp do not save and restore floating-point
- exceptions and rounding modes.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <fenv.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static jmp_buf __attribute__ ((unused)) env;
-static int result = 0;
-
-#if defined FE_TONEAREST && defined FE_TOWARDZERO
-static int expected_rounding_mode = FE_TONEAREST;
-
-static void
-change_rounding_mode (void)
-{
- if (fesetround (FE_TOWARDZERO) == 0)
- expected_rounding_mode = FE_TOWARDZERO;
- else
- puts ("fesetround (FE_TOWARDZERO) failed, continuing test");
- longjmp (env, 1);
-}
-#endif
-
-#ifdef FE_INVALID
-static int expected_exceptions = 0;
-
-static void
-raise_exception (void)
-{
- if (feraiseexcept (FE_INVALID) == 0)
- expected_exceptions = FE_INVALID;
- else
- puts ("feraiseexcept (FE_INVALID) failed, continuing test");
- longjmp (env, 1);
-}
-#endif
-
-static int
-do_test (void)
-{
-#if defined FE_TONEAREST && defined FE_TOWARDZERO
- if (fesetround (FE_TONEAREST) == 0)
- {
- if (setjmp (env) == 0)
- change_rounding_mode ();
- else
- {
- if (fegetround () == expected_rounding_mode)
- puts ("PASS: longjmp preserved rounding mode");
- else
- {
- puts ("FAIL: longjmp changed rounding mode");
- result = 1;
- }
- }
- }
- else
- puts ("fesetround (FE_TONEAREST) failed, not testing rounding modes");
-#else
- puts ("rounding mode test not supported");
-#endif
-#ifdef FE_INVALID
- if (feclearexcept (FE_ALL_EXCEPT) == 0)
- {
- if (setjmp (env) == 0)
- raise_exception ();
- else
- {
- if (fetestexcept (FE_INVALID) == expected_exceptions)
- puts ("PASS: longjmp preserved exceptions");
- else
- {
- puts ("FAIL: longjmp changed exceptions");
- result = 1;
- }
- }
- }
- else
- puts ("feclearexcept (FE_ALL_EXCEPT) failed, not testing exceptions");
-#else
- puts ("exception test not supported");
-#endif
- return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/setjmp/tst-setjmp-static.c b/setjmp/tst-setjmp-static.c
deleted file mode 100644
index 5ca5df8cb4..0000000000
--- a/setjmp/tst-setjmp-static.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "tst-setjmp.c"
diff --git a/setjmp/tst-setjmp.c b/setjmp/tst-setjmp.c
deleted file mode 100644
index 2661f21a64..0000000000
--- a/setjmp/tst-setjmp.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <stdlib.h>
-
-static jmp_buf env;
-static int last_value = -1, lose = 0;
-
-static void
-jump (int val)
-{
- longjmp (env, val);
-}
-
-static int
-do_test (void)
-{
- int value;
-
- value = setjmp (env);
- if (value != last_value + 1)
- {
- fputs("Shouldn't have ", stdout);
- lose = 1;
- }
- last_value = value;
- switch (value)
- {
- case 0:
- puts("Saved environment.");
- jump (0);
- default:
- printf ("Jumped to %d.\n", value);
- if (value < 10)
- jump (value + 1);
- }
-
- if (!lose && value == 10)
- {
- /* Do a second test, this time without `setjmp' being a macro.
- This is not required by ISO C but we have this for compatibility. */
-#undef setjmp
- extern int setjmp (jmp_buf);
-
- last_value = -1;
- lose = 0;
-
- value = setjmp (env);
- if (value != last_value + 1)
- {
- fputs("Shouldn't have ", stdout);
- lose = 1;
- }
- last_value = value;
- switch (value)
- {
- case 0:
- puts("Saved environment.");
- jump (0);
- default:
- printf ("Jumped to %d.\n", value);
- if (value < 10)
- jump (value + 1);
- }
- }
-
- if (!lose && value == 10)
- {
- /* And again for the `_setjmp' function. */
-#ifndef _setjmp
- extern int _setjmp (jmp_buf);
-#endif
- last_value = -1;
- lose = 0;
-
- value = _setjmp (env);
- if (value != last_value + 1)
- {
- fputs("Shouldn't have ", stdout);
- lose = 1;
- }
- last_value = value;
- switch (value)
- {
- case 0:
- puts("Saved environment.");
- jump (0);
- default:
- printf ("Jumped to %d.\n", value);
- if (value < 10)
- jump (value + 1);
- }
- }
-
- if (lose || value != 10)
- puts ("Test FAILED!");
- else
- puts ("Test succeeded!");
-
- return lose ? EXIT_FAILURE : EXIT_SUCCESS;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/setjmp/tst-sigsetjmp.c b/setjmp/tst-sigsetjmp.c
deleted file mode 100644
index 6c6cdf4fca..0000000000
--- a/setjmp/tst-sigsetjmp.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2013-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Test case for BZ #15493 */
-
-#include <stdlib.h>
-#include <signal.h>
-#include <setjmp.h>
-
-static int
-do_test (void)
-{
- sigjmp_buf sj;
- sigset_t m;
-
- sigemptyset (&m);
- sigprocmask (SIG_SETMASK, &m, NULL);
- if (sigsetjmp (sj, 0) == 0)
- {
- sigaddset (&m, SIGUSR1);
- sigprocmask (SIG_SETMASK, &m, NULL);
- siglongjmp (sj, 1);
- return EXIT_FAILURE;
- }
- sigprocmask (SIG_SETMASK, NULL, &m);
- return sigismember (&m, SIGUSR1) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"