Back to index

glibc  2.9
novmx-longjmp.c
Go to the documentation of this file.
00001 /* Copyright (C) 1991,92,94,95,97,98,2000,2002,2003,2004
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 /* Copy of sysdeps/generic/longjmp.c modified for backward compatibility
00021    with old non AltiVec/VMX longjmp.  */
00022 
00023 #include <bits/wordsize.h>
00024 #include <shlib-compat.h>
00025 #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
00026 # include <stddef.h>
00027 # include <novmxsetjmp.h>
00028 # include <signal.h>
00029 
00030 
00031 /* Set the signal mask to the one specified in ENV, and jump
00032    to the position specified in ENV, causing the setjmp
00033    call there to return VAL, or 1 if VAL is 0.  */
00034 void
00035 __novmx__libc_siglongjmp (__novmx__sigjmp_buf env, int val)
00036 {
00037   /* Perform any cleanups needed by the frames being unwound.  */
00038   _longjmp_unwind (env, val);
00039 
00040   if (env[0].__mask_was_saved)
00041     /* Restore the saved signal mask.  */
00042     (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
00043                        (sigset_t *) NULL);
00044 
00045   /* Call the machine-dependent function to restore machine state.  */
00046   __novmx__longjmp (env[0].__jmpbuf, val ?: 1);
00047 }
00048 
00049 strong_alias (__novmx__libc_siglongjmp, __novmx__libc_longjmp)
00050 libc_hidden_def (__novmx__libc_longjmp)
00051 weak_alias (__novmx__libc_siglongjmp, __novmx_longjmp)
00052 weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp)
00053 weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp)
00054 
00055 # if __WORDSIZE == 64
00056 symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.3);
00057 symbol_version (__novmxlongjmp,longjmp,GLIBC_2.3);
00058 symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.3);
00059 # else
00060 symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.0);
00061 symbol_version (__novmxlongjmp,longjmp,GLIBC_2.0);
00062 symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.0);
00063 # endif
00064 #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4))  */