Back to index

glibc  2.9
ptlongjmp.c
Go to the documentation of this file.
00001 /* Linuxthreads - a simple clone()-based implementation of Posix        */
00002 /* threads for Linux.                                                   */
00003 /* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr)              */
00004 /*                                                                      */
00005 /* This program is free software; you can redistribute it and/or        */
00006 /* modify it under the terms of the GNU Library General Public License  */
00007 /* as published by the Free Software Foundation; either version 2       */
00008 /* of the License, or (at your option) any later version.               */
00009 /*                                                                      */
00010 /* This program 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        */
00013 /* GNU Library General Public License for more details.                 */
00014 
00015 /* Redefine siglongjmp and longjmp so that they interact correctly
00016    with cleanup handlers */
00017 /* Derived from linuxthreads/ptlongjmp.c & added AltiVec/VMX versioning. */
00018 #include "pthread.h"
00019 #include <setjmp.h>
00020 #include <bits/wordsize.h>
00021 #include <shlib-compat.h>
00022 #if defined SHARED
00023 # if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4)
00024 
00025 /* These functions are not declared anywhere since they shouldn't be
00026    used at another place but here.  */
00027 extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val)
00028      __attribute__ ((noreturn));
00029 extern void __novmx__libc_longjmp (sigjmp_buf env, int val)
00030      __attribute__ ((noreturn));
00031 
00032 
00033 void __novmx_siglongjmp (sigjmp_buf env, int val)
00034 {
00035   __novmx__libc_siglongjmp (env, val);
00036 }
00037 
00038 void __novmx_longjmp (jmp_buf env, int val)
00039 {
00040   __novmx__libc_longjmp (env, val);
00041 }
00042 
00043 #  if __WORDSIZE == 64
00044 symbol_version (__novmx_longjmp,longjmp,GLIBC_2.3);
00045 symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.3);
00046 #  else
00047 symbol_version (__novmx_longjmp,longjmp,GLIBC_2.0);
00048 symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.0);
00049 #  endif
00050 # endif  /* SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4) ) */
00051 
00052 /* These functions are not declared anywhere since they shouldn't be
00053    used at another place but here.  */
00054 extern void __vmx__libc_siglongjmp (sigjmp_buf env, int val)
00055      __attribute__ ((noreturn));
00056 extern void __vmx__libc_longjmp (sigjmp_buf env, int val)
00057      __attribute__ ((noreturn));
00058 
00059 void __vmx_siglongjmp (sigjmp_buf env, int val)
00060 {
00061   __vmx__libc_siglongjmp (env, val);
00062 }
00063 
00064 void __vmx_longjmp (jmp_buf env, int val)
00065 {
00066   __vmx__libc_longjmp (env, val);
00067 }
00068 default_symbol_version (__vmx_longjmp,longjmp,GLIBC_2.3.4);
00069 default_symbol_version (__vmx_siglongjmp,siglongjmp,GLIBC_2.3.4);
00070 #endif /* SHARED */