errno.h 700 B

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2014 Samsung Electronics
  4. * Przemyslaw Marczak <p.marczak@samsung.com>
  5. */
  6. #ifndef _ERRNO_H
  7. #define _ERRNO_H
  8. #include <linux/errno.h>
  9. extern int errno;
  10. #define __set_errno(val) do { errno = val; } while (0)
  11. /**
  12. * errno_str() - get description for error number
  13. *
  14. * @errno: error number (negative in case of error)
  15. * Return: string describing the error. If CONFIG_ERRNO_STR is not
  16. * defined an empty string is returned.
  17. */
  18. #ifdef CONFIG_ERRNO_STR
  19. const char *errno_str(int errno);
  20. #else
  21. static const char error_message[] = "";
  22. static inline const char *errno_str(int errno)
  23. {
  24. return error_message;
  25. }
  26. #endif
  27. #endif /* _ERRNO_H */