xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_errno.cc (revision a7c257b03e4462df2b1020128fb82716512d7856)
1 //===-- sanitizer_errno.cc --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file is shared between sanitizers run-time libraries.
11 //
12 // Defines errno to avoid including errno.h and its dependencies into other
13 // files (e.g. interceptors are not supposed to include any system headers).
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #include "sanitizer_errno_codes.h"
18 #include "sanitizer_internal_defs.h"
19 
20 #include <errno.h>
21 
22 namespace __sanitizer {
23 
24 COMPILER_CHECK(errno_ENOMEM == ENOMEM);
25 COMPILER_CHECK(errno_EBUSY == EBUSY);
26 COMPILER_CHECK(errno_EINVAL == EINVAL);
27 
28 // EOWNERDEAD is not present in some older platforms.
29 #if defined(EOWNERDEAD)
30 extern const int errno_EOWNERDEAD = EOWNERDEAD;
31 #else
32 extern const int errno_EOWNERDEAD = -1;
33 #endif
34 
35 }  // namespace __sanitizer
36