sanitizer_errno.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. //===-- sanitizer_errno.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. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is shared between sanitizers run-time libraries.
  10. //
  11. // Defines errno to avoid including errno.h and its dependencies into other
  12. // files (e.g. interceptors are not supposed to include any system headers).
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #include "sanitizer_errno_codes.h"
  16. #include "sanitizer_internal_defs.h"
  17. #include <errno.h>
  18. namespace __sanitizer {
  19. COMPILER_CHECK(errno_ENOMEM == ENOMEM);
  20. COMPILER_CHECK(errno_EBUSY == EBUSY);
  21. COMPILER_CHECK(errno_EINVAL == EINVAL);
  22. // EOWNERDEAD is not present in some older platforms.
  23. #if defined(EOWNERDEAD)
  24. extern const int errno_EOWNERDEAD = EOWNERDEAD;
  25. #else
  26. extern const int errno_EOWNERDEAD = -1;
  27. #endif
  28. } // namespace __sanitizer