Blame nptl/pt-vfork.c

Packit Service 3e830d
/* vfork ABI-compatibility entry points for libpthread.
Packit Service 3e830d
   Copyright (C) 2014-2018 Free Software Foundation, Inc.
Packit Service 3e830d
   This file is part of the GNU C Library.
Packit Service 3e830d
Packit Service 3e830d
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 3e830d
   modify it under the terms of the GNU Lesser General Public
Packit Service 3e830d
   License as published by the Free Software Foundation; either
Packit Service 3e830d
   version 2.1 of the License, or (at your option) any later version.
Packit Service 3e830d
Packit Service 3e830d
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 3e830d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 3e830d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 3e830d
   Lesser General Public License for more details.
Packit Service 3e830d
Packit Service 3e830d
   You should have received a copy of the GNU Lesser General Public
Packit Service 3e830d
   License along with the GNU C Library; if not, see
Packit Service 3e830d
   <http://www.gnu.org/licenses/>.  */
Packit Service 3e830d
Packit Service 3e830d
#include <unistd.h>
Packit Service 3e830d
#include <shlib-compat.h>
Packit Service 3e830d
Packit Service 3e830d
/* libpthread used to have its own vfork implementation that differed
Packit Service 3e830d
   from libc's only in having a pointless micro-optimization.  There
Packit Service 3e830d
   is no longer any use to having a separate copy in libpthread, but
Packit Service 3e830d
   the historical ABI requires it.  For static linking, there is no
Packit Service 3e830d
   need to provide anything here--the libc version will be linked in.
Packit Service 3e830d
   For shared library ABI compatibility, there must be __vfork and
Packit Service 3e830d
   vfork symbols in libpthread.so; so we define them using IFUNC to
Packit Service 3e830d
   redirect to the libc function.  */
Packit Service 3e830d
Packit Service 3e830d
/* Note! If the architecture doesn't support IFUNC, then we need an
Packit Service 3e830d
   alternate target-specific mechanism to implement this.  So we just
Packit Service 3e830d
   assume IFUNC here and require that the target override this file
Packit Service 3e830d
   if necessary.
Packit Service 3e830d
Packit Service 3e830d
   If the architecture can assume all supported versions of gcc will
Packit Service 3e830d
   produce a tail-call to __libc_vfork, consider including the version
Packit Service 3e830d
   in sysdeps/unix/sysv/linux/aarch64/pt-vfork.c.  */
Packit Service 3e830d
Packit Service 3e830d
#if !HAVE_IFUNC
Packit Service 3e830d
# error "must write pt-vfork for this machine or get IFUNC support"
Packit Service 3e830d
#endif
Packit Service 3e830d
Packit Service 3e830d
#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
Packit Service 3e830d
     || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
Packit Service 3e830d
Packit Service 3e830d
extern __typeof (vfork) __libc_vfork;   /* Defined in libc.  */
Packit Service 3e830d
Packit Service 3e830d
# undef INIT_ARCH
Packit Service 3e830d
# define INIT_ARCH()
Packit Service 3e830d
# define DEFINE_VFORK(name) libc_ifunc (name, &__libc_vfork)
Packit Service 3e830d
Packit Service 3e830d
#endif
Packit Service 3e830d
Packit Service 3e830d
#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
Packit Service 3e830d
extern __typeof(vfork) vfork_ifunc;
Packit Service 3e830d
DEFINE_VFORK (vfork_ifunc)
Packit Service 3e830d
compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0);
Packit Service 3e830d
#endif
Packit Service 3e830d
Packit Service 3e830d
#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
Packit Service 3e830d
extern __typeof(vfork) __vfork_ifunc;
Packit Service 3e830d
DEFINE_VFORK (__vfork_ifunc)
Packit Service 3e830d
compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2);
Packit Service 3e830d
#endif