Remove dependence on <ciso646> (#73273)
[llvm-project.git] / libc / src / compiler / generic / __stack_chk_fail.cpp
blob00e976ad8bc2a16af1eb00077f30c23faf2e83b9
1 //===-- Implementation of __stack_chk_fail --------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "src/compiler/__stack_chk_fail.h"
10 #include "src/__support/OSUtil/io.h"
11 #include "src/stdlib/abort.h"
12 #include <stdint.h> // For uintptr_t
14 extern "C" {
16 uintptr_t __stack_chk_guard = static_cast<uintptr_t>(0xa9fff01234);
18 void __stack_chk_fail(void) {
19 LIBC_NAMESPACE::write_to_stderr("stack smashing detected\n");
20 LIBC_NAMESPACE::abort();
23 } // extern "C"