Don't strip static archives.
[glibc.git] / setjmp / longjmp.c
blob8545b36627ebeccf386fccf031a6773db2f2ed0a
1 /* Copyright (C) 1991,92,94,95,97,98,2000,2002,2009
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #include <stddef.h>
21 #include <setjmp.h>
22 #include <signal.h>
25 /* Set the signal mask to the one specified in ENV, and jump
26 to the position specified in ENV, causing the setjmp
27 call there to return VAL, or 1 if VAL is 0. */
28 void
29 __libc_siglongjmp (sigjmp_buf env, int val)
31 /* Perform any cleanups needed by the frames being unwound. */
32 _longjmp_unwind (env, val);
34 if (env[0].__mask_was_saved)
35 /* Restore the saved signal mask. */
36 (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
37 (sigset_t *) NULL);
39 /* Call the machine-dependent function to restore machine state. */
40 __longjmp (env[0].__jmpbuf, val ?: 1);
43 #ifndef __libc_siglongjmp
44 strong_alias (__libc_siglongjmp, __libc_longjmp)
45 libc_hidden_def (__libc_longjmp)
46 weak_alias (__libc_siglongjmp, _longjmp)
47 weak_alias (__libc_siglongjmp, longjmp)
48 weak_alias (__libc_siglongjmp, siglongjmp)
49 #endif