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 
00018 #include <setjmp.h>
00019 #include "pthread.h"
00020 #include "internals.h"
00021 
00022 /* These functions are not declared anywhere since they shouldn't be
00023    used at another place but here.  */
00024 extern void __libc_siglongjmp (sigjmp_buf env, int val)
00025      __attribute__ ((noreturn));
00026 extern void __libc_longjmp (sigjmp_buf env, int val)
00027      __attribute__ ((noreturn));
00028 
00029 #ifdef SHARED
00030 void siglongjmp (sigjmp_buf env, int val)
00031 {
00032   __libc_siglongjmp (env, val);
00033 }
00034 
00035 void longjmp (jmp_buf env, int val)
00036 {
00037   __libc_longjmp (env, val);
00038 }
00039 #endif