annotate libsanitizer/sanitizer_common/sanitizer_errno.cc @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 //===-- sanitizer_errno.cc --------------------------------------*- C++ -*-===//
kono
parents:
diff changeset
2 //
kono
parents:
diff changeset
3 // This file is distributed under the University of Illinois Open Source
kono
parents:
diff changeset
4 // License. See LICENSE.TXT for details.
kono
parents:
diff changeset
5 //
kono
parents:
diff changeset
6 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
7 //
kono
parents:
diff changeset
8 // This file is shared between sanitizers run-time libraries.
kono
parents:
diff changeset
9 //
kono
parents:
diff changeset
10 // Defines errno to avoid including errno.h and its dependencies into other
kono
parents:
diff changeset
11 // files (e.g. interceptors are not supposed to include any system headers).
kono
parents:
diff changeset
12 //
kono
parents:
diff changeset
13 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 #include "sanitizer_errno_codes.h"
kono
parents:
diff changeset
16 #include "sanitizer_internal_defs.h"
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 #include <errno.h>
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 namespace __sanitizer {
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 COMPILER_CHECK(errno_ENOMEM == ENOMEM);
kono
parents:
diff changeset
23 COMPILER_CHECK(errno_EBUSY == EBUSY);
kono
parents:
diff changeset
24 COMPILER_CHECK(errno_EINVAL == EINVAL);
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 // EOWNERDEAD is not present in some older platforms.
kono
parents:
diff changeset
27 #if defined(EOWNERDEAD)
kono
parents:
diff changeset
28 extern const int errno_EOWNERDEAD = EOWNERDEAD;
kono
parents:
diff changeset
29 #else
kono
parents:
diff changeset
30 extern const int errno_EOWNERDEAD = -1;
kono
parents:
diff changeset
31 #endif
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 } // namespace __sanitizer