[Clang][SME2] Enable multi-vector loads & stores for SME2 (#75821)
[llvm-project.git] / compiler-rt / lib / scudo / standalone / report_linux.cpp
blob6a983036e6cd9f705cad3d038818d1f27ae6927a
1 //===-- report_linux.cpp ----------------------------------------*- 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 //===----------------------------------------------------------------------===//
9 #include "platform.h"
11 #if SCUDO_LINUX || SCUDO_TRUSTY
13 #include "common.h"
14 #include "internal_defs.h"
15 #include "report.h"
16 #include "report_linux.h"
17 #include "string_utils.h"
19 #include <errno.h>
20 #include <stdlib.h>
21 #include <string.h>
23 namespace scudo {
25 // Fatal internal map() error (potentially OOM related).
26 void NORETURN reportMapError(uptr SizeIfOOM) {
27 char Error[128] = "Scudo ERROR: internal map failure\n";
28 if (SizeIfOOM) {
29 formatString(
30 Error, sizeof(Error),
31 "Scudo ERROR: internal map failure (NO MEMORY) requesting %zuKB\n",
32 SizeIfOOM >> 10);
34 reportRawError(Error);
37 void NORETURN reportUnmapError(uptr Addr, uptr Size) {
38 char Error[128];
39 formatString(Error, sizeof(Error),
40 "Scudo ERROR: internal unmap failure (error desc=%s) Addr 0x%zx "
41 "Size %zu\n",
42 strerror(errno), Addr, Size);
43 reportRawError(Error);
46 void NORETURN reportProtectError(uptr Addr, uptr Size, int Prot) {
47 char Error[128];
48 formatString(
49 Error, sizeof(Error),
50 "Scudo ERROR: internal protect failure (error desc=%s) Addr 0x%zx "
51 "Size %zu Prot %x\n",
52 strerror(errno), Addr, Size, Prot);
53 reportRawError(Error);
56 } // namespace scudo
58 #endif // SCUDO_LINUX || SCUDO_TRUSTY