24 lines · cpp
1//===------------ MacOS implementation of an exit function ------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "src/__support/OSUtil/darwin/syscall.h" // syscall_impl10#include "src/__support/common.h"11#include "src/__support/macros/config.h"12#include "sys/syscall.h" // For syscall numbers.13 14namespace LIBC_NAMESPACE_DECL {15namespace internal {16 17[[noreturn]] void exit(int status) {18 for (;;)19 LIBC_NAMESPACE::syscall_impl<long>(SYS_exit, status);20}21 22} // namespace internal23} // namespace LIBC_NAMESPACE_DECL24