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