1d6698386SAlex Brachet //===-- Implementation of exit --------------------------------------------===//
2d6698386SAlex Brachet //
3d6698386SAlex Brachet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4d6698386SAlex Brachet // See https://llvm.org/LICENSE.txt for license information.
5d6698386SAlex Brachet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6d6698386SAlex Brachet //
7d6698386SAlex Brachet //===----------------------------------------------------------------------===//
8d6698386SAlex Brachet 
9d6698386SAlex Brachet #include "src/stdlib/exit.h"
10d6698386SAlex Brachet #include "src/__support/common.h"
11d6698386SAlex Brachet #include "src/stdlib/_Exit.h"
12d6698386SAlex Brachet 
13d6698386SAlex Brachet namespace __llvm_libc {
14d6698386SAlex Brachet 
15d6698386SAlex Brachet namespace internal {
16*19c60980SSiva Chandra Reddy void call_exit_callbacks();
17d6698386SAlex Brachet }
18d6698386SAlex Brachet 
19d6698386SAlex Brachet LLVM_LIBC_FUNCTION(void, exit, (int status)) {
20*19c60980SSiva Chandra Reddy   internal::call_exit_callbacks();
21d6698386SAlex Brachet   _Exit(status);
22d6698386SAlex Brachet }
23d6698386SAlex Brachet 
24d6698386SAlex Brachet } // namespace __llvm_libc
25