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
22namespace __sanitizer {
23
24COMPILER_CHECK(errno_ENOMEM == ENOMEM);
25COMPILER_CHECK(errno_EBUSY == EBUSY);
26COMPILER_CHECK(errno_EINVAL == EINVAL);
27
28// EOWNERDEAD is not present in some older platforms.
29#if defined(EOWNERDEAD)
30extern const int errno_EOWNERDEAD = EOWNERDEAD;
31#else
32extern const int errno_EOWNERDEAD = -1;
33#endif
34
35}  // namespace __sanitizer
36