1 //===---------- Linux implementation of a quick 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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_QUICK_EXIT_H 10 #define LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_QUICK_EXIT_H 11 12 #include "include/sys/syscall.h" // For syscall numbers. 13 #include "syscall.h" // For internal syscall function. 14 15 namespace __llvm_libc { 16 17 static inline void quick_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 26 #endif // LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_QUICK_EXIT_H 27