xref: /freebsd/contrib/llvm-project/compiler-rt/lib/scudo/standalone/report_linux.h (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1 //===-- report_linux.h ------------------------------------------*- 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 SCUDO_REPORT_LINUX_H_
10 #define SCUDO_REPORT_LINUX_H_
11 
12 #include "platform.h"
13 
14 #if SCUDO_LINUX || SCUDO_TRUSTY
15 
16 #include "internal_defs.h"
17 
18 namespace scudo {
19 
20 // Report a fatal error when a map call fails. SizeIfOOM shall
21 // hold the requested size on an out-of-memory error, 0 otherwise.
22 void NORETURN reportMapError(uptr SizeIfOOM = 0);
23 
24 // Report a fatal error when an unmap call fails.
25 void NORETURN reportUnmapError(uptr Addr, uptr Size);
26 
27 // Report a fatal error when a mprotect call fails.
28 void NORETURN reportProtectError(uptr Addr, uptr Size, int Prot);
29 
30 } // namespace scudo
31 
32 #endif // SCUDO_LINUX || SCUDO_TRUSTY
33 
34 #endif // SCUDO_REPORT_LINUX_H_
35