errno.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright (c) mlibc & plct lab
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef MLIBC_SYS_ERRNO_H__
  10. #define MLIBC_SYS_ERRNO_H__
  11. #define EOK 0
  12. #define EPERM 1 /* Operation not permitted */
  13. #define ENOENT 2 /* No such file or directory */
  14. #define ESRCH 3 /* No such process */
  15. #define EINTR 4 /* Interrupted system call */
  16. #define EIO 5 /* Input/output error */
  17. #define ENXIO 6 /* Device not configured */
  18. #define E2BIG 7 /* Argument list too long */
  19. #define ENOEXEC 8 /* Exec format error */
  20. #define EBADF 9 /* Bad file descriptor */
  21. #define ECHILD 10 /* No child processes */
  22. #define EDEADLK 11 /* Resource deadlock avoided */
  23. /* 11 was EAGAIN */
  24. #define ENOMEM 12 /* Cannot allocate memory */
  25. #define EACCES 13 /* Permission denied */
  26. #define EFAULT 14 /* Bad address */
  27. #define ENOTBLK 15 /* Block device required */
  28. #define EBUSY 16 /* Device / Resource busy */
  29. #define EEXIST 17 /* File exists */
  30. #define EXDEV 18 /* Cross-device link */
  31. #define ENODEV 19 /* Operation not supported by device */
  32. #define ENOTDIR 20 /* Not a directory */
  33. #define EISDIR 21 /* Is a directory */
  34. #define EINVAL 22 /* Invalid argument */
  35. #define ENFILE 23 /* Too many open files in system */
  36. #define EMFILE 24 /* Too many open files */
  37. #define ENOTTY 25 /* Inappropriate ioctl for device */
  38. #define ETXTBSY 26 /* Text file busy */
  39. #define EFBIG 27 /* File too large */
  40. #define ENOSPC 28 /* No space left on device */
  41. #define ESPIPE 29 /* Illegal seek */
  42. #define EROFS 30 /* Read-only file system */
  43. #define EMLINK 31 /* Too many links */
  44. #define EPIPE 32 /* Broken pipe */
  45. /* math software */
  46. #define EDOM 33 /* Numerical argument out of domain */
  47. #define ERANGE 34 /* Result too large */
  48. /* non-blocking and interrupt i/o */
  49. #define EAGAIN 35 /* Resource temporarily unavailable */
  50. #define EWOULDBLOCK EAGAIN /* Operation would block */
  51. #define EINPROGRESS 36 /* Operation now in progress */
  52. #define EALREADY 37 /* Operation already in progress */
  53. /* ipc/network software -- argument errors */
  54. #define ENOTSOCK 38 /* Socket operation on non-socket */
  55. #define EDESTADDRREQ 39 /* Destination address required */
  56. #define EMSGSIZE 40 /* Message too long */
  57. #define EPROTOTYPE 41 /* Protocol wrong type for socket */
  58. #define ENOPROTOOPT 42 /* Protocol not available */
  59. #define EPROTONOSUPPORT 43 /* Protocol not supported */
  60. #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
  61. #define ENOTSUP 45 /* Operation not supported */
  62. #define EOPNOTSUPP ENOTSUP /* Operation not supported on socket */
  63. #define EPFNOSUPPORT 46 /* Protocol family not supported */
  64. #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
  65. #define EADDRINUSE 48 /* Address already in use */
  66. #define EADDRNOTAVAIL 49 /* Can't assign requested address */
  67. /* ipc/network software -- operational errors */
  68. #define ENETDOWN 50 /* Network is down */
  69. #define ENETUNREACH 51 /* Network is unreachable */
  70. #define ENETRESET 52 /* Network dropped connection on reset */
  71. #define ECONNABORTED 53 /* Software caused connection abort */
  72. #define ECONNRESET 54 /* Connection reset by peer */
  73. #define ENOBUFS 55 /* No buffer space available */
  74. #define EISCONN 56 /* Socket is already connected */
  75. #define ENOTCONN 57 /* Socket is not connected */
  76. #define ESHUTDOWN 58 /* Can't send after socket shutdown */
  77. #define ETOOMANYREFS 59 /* Too many references: can't splice */
  78. #define ETIMEDOUT 60 /* Operation timed out */
  79. #define ECONNREFUSED 61 /* Connection refused */
  80. #define ELOOP 62 /* Too many levels of symbolic links */
  81. #define ENAMETOOLONG 63 /* File name too long */
  82. /* should be rearranged */
  83. #define EHOSTDOWN 64 /* Host is down */
  84. #define EHOSTUNREACH 65 /* No route to host */
  85. #define ENOTEMPTY 66 /* Directory not empty */
  86. /* quotas & mush */
  87. #define EPROCLIM 67 /* Too many processes */
  88. #define EUSERS 68 /* Too many users */
  89. #define EDQUOT 69 /* Disc quota exceeded */
  90. /* Network File System */
  91. #define ESTALE 70 /* Stale NFS file handle */
  92. #define EREMOTE 71 /* Too many levels of remote in path */
  93. #define EBADRPC 72 /* RPC struct is bad */
  94. #define ERPCMISMATCH 73 /* RPC version wrong */
  95. #define EPROGUNAVAIL 74 /* RPC prog. not avail */
  96. #define EPROGMISMATCH 75 /* Program version wrong */
  97. #define EPROCUNAVAIL 76 /* Bad procedure for program */
  98. #define ENOLCK 77 /* No locks available */
  99. #define ENOSYS 78 /* Function not implemented */
  100. #define EFTYPE 79 /* Inappropriate file type or format */
  101. #define EAUTH 80 /* Authentication error */
  102. #define ENEEDAUTH 81 /* Need authenticator */
  103. /* Intelligent device errors */
  104. #define EPWROFF 82 /* Device power is off */
  105. #define EDEVERR 83 /* Device error, e.g. paper out */
  106. #define EOVERFLOW 84 /* Value too large to be stored in data type */
  107. /* Program loading errors */
  108. #define ERESTART 85
  109. #define EBADEXEC 85 /* Bad executable */
  110. #define EBADARCH 86 /* Bad CPU type in executable */
  111. #define ESHLIBVERS 87 /* Shared library version mismatch */
  112. #define EBADMACHO 88 /* Malformed Macho file */
  113. #define ECANCELED 89 /* Operation canceled */
  114. #define EIDRM 90 /* Identifier removed */
  115. #define ENOMSG 91 /* No message of desired type */
  116. #define EILSEQ 92 /* Illegal byte sequence */
  117. #define ENOATTR 93 /* Attribute not found */
  118. #define EBADMSG 94 /* Bad message */
  119. #define EMULTIHOP 95 /* Reserved */
  120. #define ENODATA 96 /* No message available on STREAM */
  121. #define ENOLINK 97 /* Reserved */
  122. #define ENOSR 98 /* No STREAM resources */
  123. #define ENOSTR 99 /* Not a STREAM */
  124. #define EPROTO 100 /* Protocol error */
  125. #define ETIME 101 /* STREAM ioctl timeout */
  126. #define ENOPOLICY 103 /* No such policy registered */
  127. #define ENOTRECOVERABLE 104 /* State not recoverable */
  128. #define EOWNERDEAD 105 /* Previous owner died */
  129. #define EQFULL 106 /* Interface output queue is full */
  130. #define ELAST 106 /* Must be equal largest errno */
  131. #endif /*MLIBC_SYS_ERRNO_H__*/