errno.h 657 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * Minimal errno definitions for NOLIBC
  4. * Copyright (C) 2017-2022 Willy Tarreau <w@1wt.eu>
  5. */
  6. /* make sure to include all global symbols */
  7. #include "nolibc.h"
  8. #ifndef _NOLIBC_ERRNO_H
  9. #define _NOLIBC_ERRNO_H
  10. #include <linux/errno.h>
  11. #ifndef NOLIBC_IGNORE_ERRNO
  12. #define SET_ERRNO(v) do { errno = (v); } while (0)
  13. int errno __attribute__((weak));
  14. #else
  15. #define SET_ERRNO(v) do { } while (0)
  16. #endif
  17. /* errno codes all ensure that they will not conflict with a valid pointer
  18. * because they all correspond to the highest addressable memory page.
  19. */
  20. #define MAX_ERRNO 4095
  21. #endif /* _NOLIBC_ERRNO_H */