Blame stdlib/quick_exit.c

Packit Service 82fcde
/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#include <stdio.h>
Packit Service 82fcde
#include <stdlib.h>
Packit Service 82fcde
#include <unistd.h>
Packit Service 82fcde
#include <sysdep.h>
Packit Service 82fcde
#include <signal.h>
Packit Service 82fcde
#include <errno.h>
Packit Service 82fcde
#include <shlib-compat.h>
Packit Service 82fcde
#include "exit.h"
Packit Service 82fcde
Packit Service 82fcde
void
Packit Service 82fcde
__new_quick_exit (int status)
Packit Service 82fcde
{
Packit Service 82fcde
  /* The new quick_exit, following C++11 18.5.12, does not run object
Packit Service 82fcde
     destructors.   While C11 says nothing about object destructors,
Packit Service 82fcde
     since it has none, the intent is to run the registered
Packit Service 82fcde
     at_quick_exit handlers and then run _Exit immediately without
Packit Service 82fcde
     disturbing the state of the process and threads.  */
Packit Service 82fcde
  __run_exit_handlers (status, &__quick_exit_funcs, false, false);
Packit Service 82fcde
}
Packit Service 82fcde
versioned_symbol (libc, __new_quick_exit, quick_exit, GLIBC_2_24);
Packit Service 82fcde
Packit Service 82fcde
#if SHLIB_COMPAT(libc, GLIBC_2_10, GLIBC_2_24)
Packit Service 82fcde
void
Packit Service 82fcde
attribute_compat_text_section
Packit Service 82fcde
__old_quick_exit (int status)
Packit Service 82fcde
{
Packit Service 82fcde
  /* The old quick_exit runs thread_local destructors.  */
Packit Service 82fcde
  __run_exit_handlers (status, &__quick_exit_funcs, false, true);
Packit Service 82fcde
}
Packit Service 82fcde
compat_symbol (libc, __old_quick_exit, quick_exit, GLIBC_2_10);
Packit Service 82fcde
#endif