1 //===------------------- Linux Implementation of _Exit --------------------===// 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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "config/linux/syscall.h" // For internal syscall function. 10 #include "include/sys/syscall.h" // For syscall numbers. 11 #include "src/__support/common.h" 12 13 #include "src/stdlib/_Exit.h" 14 15 namespace __llvm_libc { 16 LLVM_LIBC_ENTRYPOINT(_Exit)17void LLVM_LIBC_ENTRYPOINT(_Exit)(int status) { 18 for (;;) { 19 __llvm_libc::syscall(SYS_exit_group, status); 20 __llvm_libc::syscall(SYS_exit, status); 21 } 22 } 23 24 } // namespace __llvm_libc 25