From 05babf965ec39be7e1c8a7306ec1c60b1e614654 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 18 Oct 2016 02:10:41 +0200 Subject: Fix unregistering atfork handlers on library unload * sysdeps/generic/old_pt-atfork.c: New file. * Makefile (libpthread-routines): Add old_pt-atfork. (libpthread-static-only-routines): Add pt-atfork. [build-shared=yes] (install): Explicit $(inst_libdir)/libpthread.so [build-shared=yes] $(inst_libdir)/libpthread.so: Replace with script to link libpthread_nonshared.a in. [build-shared=yes] (tests): Link libpthread_nonshared.a in addition to libpthread.so. (generated): Add libpthread_nonshared.a. --- sysdeps/generic/old_pt-atfork.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sysdeps/generic/old_pt-atfork.c (limited to 'sysdeps/generic/old_pt-atfork.c') diff --git a/sysdeps/generic/old_pt-atfork.c b/sysdeps/generic/old_pt-atfork.c new file mode 100644 index 0000000..5366eaa --- /dev/null +++ b/sysdeps/generic/old_pt-atfork.c @@ -0,0 +1,27 @@ +/* Register fork handlers. Generic version. + Copyright (C) 2002 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#if SHLIB_COMPAT(libpthread, GLIBC_2_12, GLIBC_2_23) +# define pthread_atfork __dyn_pthread_atfork +# include "pt-atfork.c" +# undef pthread_atfork +compat_symbol (libpthread, __dyn_pthread_atfork, pthread_atfork, GLIBC_2_12); +#endif -- cgit v1.2.3