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
18namespace 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.
22void NORETURN reportMapError(uptr SizeIfOOM = 0);
23
24// Report a fatal error when a map call using a fixed address doesn't
25// return the requested address.
26void NORETURN reportMapFixedError(uptr ExpectedAddr, uptr RequestedAddr);
27
28// Report a fatal error when an unmap call fails.
29void NORETURN reportUnmapError(uptr Addr, uptr Size);
30
31// Report a fatal error when a mprotect call fails.
32void NORETURN reportProtectError(uptr Addr, uptr Size, int Prot);
33
34} // namespace scudo
35
36#endif // SCUDO_LINUX || SCUDO_TRUSTY
37
38#endif // SCUDO_REPORT_LINUX_H_
39