errno.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * Copyright (c) 1984-1999, 2012 Wind River Systems, Inc.
  3. * Copyright (c) 2021 Nordic Semiconductor ASA
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. */
  7. /*
  8. * Copyright (c) 1982, 1986 Regents of the University of California.
  9. * All rights reserved. The Berkeley software License Agreement
  10. * specifies the terms and conditions for redistribution.
  11. *
  12. * @(#)errno.h 7.1 (Berkeley) 6/4/86
  13. */
  14. /**
  15. * @file
  16. * @brief System error numbers
  17. */
  18. #ifndef ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_ERRNO_H_
  19. #define ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_ERRNO_H_
  20. /**
  21. * @brief System error numbers
  22. * Error codes returned by functions.
  23. * Includes a list of those defined by IEEE Std 1003.1-2017.
  24. *
  25. * This file is supposed to be used together with ARMClang and
  26. * #define _AEABI_PORTABILITY_LEVEL 1
  27. * or
  28. * -D_AEABI_PORTABILITY_LEVEL=1
  29. *
  30. * For details, please refer to the document:
  31. * 'C Library ABI for the Arm® Architecture, 2021Q1'
  32. *
  33. * @defgroup system_errno Error numbers
  34. * @ingroup c_std_lib
  35. * @{
  36. */
  37. #include <sys/errno_private.h>
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. #define errno (*z_errno())
  42. #define EPERM 1 /**< Not owner */
  43. #define ENOENT 2 /**< No such file or directory */
  44. #define ESRCH 3 /**< No such context */
  45. #define EINTR 4 /**< Interrupted system call */
  46. #define EIO 5 /**< I/O error */
  47. #define ENXIO 6 /**< No such device or address */
  48. #define E2BIG 7 /**< Arg list too long */
  49. #define ENOEXEC 8 /**< Exec format error */
  50. #define EBADF 9 /**< Bad file number */
  51. #define ECHILD 10 /**< No children */
  52. #define EAGAIN 11 /**< No more contexts */
  53. #define ENOMEM 12 /**< Not enough core */
  54. #define EACCES 13 /**< Permission denied */
  55. #define EFAULT 14 /**< Bad address */
  56. #define ENOTBLK 15 /**< Block device required */
  57. #define EBUSY 16 /**< Mount device busy */
  58. #define EEXIST 17 /**< File exists */
  59. #define EXDEV 18 /**< Cross-device link */
  60. #define ENODEV 19 /**< No such device */
  61. #define ENOTDIR 20 /**< Not a directory */
  62. #define EISDIR 21 /**< Is a directory */
  63. #define EINVAL 22 /**< Invalid argument */
  64. #define ENFILE 23 /**< File table overflow */
  65. #define EMFILE 24 /**< Too many open files */
  66. #define ENOTTY 25 /**< Not a typewriter */
  67. #define ETXTBSY 26 /**< Text file busy */
  68. #define EFBIG 27 /**< File too large */
  69. #define ENOSPC 28 /**< No space left on device */
  70. #define ESPIPE 29 /**< Illegal seek */
  71. #define EROFS 30 /**< Read-only file system */
  72. #define EMLINK 31 /**< Too many links */
  73. #define EPIPE 32 /**< Broken pipe */
  74. /* Implemented in errno.c Argument too large */
  75. /* Implemented in errno.c Result too large */
  76. #define ENOMSG 35 /**< Unexpected message type */
  77. #define EDEADLK 45 /**< Resource deadlock avoided */
  78. #define ENOLCK 46 /**< No locks available */
  79. #define ENOSTR 60 /**< STREAMS device required */
  80. #define ENODATA 61 /**< Missing expected message data */
  81. #define ETIME 62 /**< STREAMS timeout occurred */
  82. #define ENOSR 63 /**< Insufficient memory */
  83. #define EPROTO 71 /**< Generic STREAMS error */
  84. #define EBADMSG 77 /**< Invalid STREAMS message */
  85. #define ENOSYS 88 /**< Function not implemented */
  86. #define ENOTEMPTY 90 /**< Directory not empty */
  87. #define ENAMETOOLONG 91 /**< File name too long */
  88. #define ELOOP 92 /**< Too many levels of symbolic links */
  89. #define EOPNOTSUPP 95 /**< Operation not supported on socket */
  90. #define EPFNOSUPPORT 96 /**< Protocol family not supported */
  91. #define ECONNRESET 104 /**< Connection reset by peer */
  92. #define ENOBUFS 105 /**< No buffer space available */
  93. #define EAFNOSUPPORT 106 /**< Addr family not supported */
  94. #define EPROTOTYPE 107 /**< Protocol wrong type for socket */
  95. #define ENOTSOCK 108 /**< Socket operation on non-socket */
  96. #define ENOPROTOOPT 109 /**< Protocol not available */
  97. #define ESHUTDOWN 110 /**< Can't send after socket shutdown */
  98. #define ECONNREFUSED 111 /**< Connection refused */
  99. #define EADDRINUSE 112 /**< Address already in use */
  100. #define ECONNABORTED 113 /**< Software caused connection abort */
  101. #define ENETUNREACH 114 /**< Network is unreachable */
  102. #define ENETDOWN 115 /**< Network is down */
  103. #define ETIMEDOUT 116 /**< Connection timed out */
  104. #define EHOSTDOWN 117 /**< Host is down */
  105. #define EHOSTUNREACH 118 /**< No route to host */
  106. #define EINPROGRESS 119 /**< Operation now in progress */
  107. #define EALREADY 120 /**< Operation already in progress */
  108. #define EDESTADDRREQ 121 /**< Destination address required */
  109. #define EMSGSIZE 122 /**< Message size */
  110. #define EPROTONOSUPPORT 123 /**< Protocol not supported */
  111. #define ESOCKTNOSUPPORT 124 /**< Socket type not supported */
  112. #define EADDRNOTAVAIL 125 /**< Can't assign requested address */
  113. #define ENETRESET 126 /**< Network dropped connection on reset */
  114. #define EISCONN 127 /**< Socket is already connected */
  115. #define ENOTCONN 128 /**< Socket is not connected */
  116. #define ETOOMANYREFS 129 /**< Too many references: can't splice */
  117. #define ENOTSUP 134 /**< Unsupported value */
  118. /* Implemented in errno.c Illegal byte sequence */
  119. #define EOVERFLOW 139 /**< Value overflow */
  120. #define ECANCELED 140 /**< Operation canceled */
  121. #define EWOULDBLOCK EAGAIN /**< Operation would block */
  122. /**
  123. * @}
  124. */
  125. #include_next <errno.h>
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #endif /* ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_ERRNO_H_ */