errno.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #define ENUMERATE_ERRNO_CODES(E) \
  9. E(ESUCCESS, "Success (not an error)") \
  10. E(EPERM, "Operation not permitted") \
  11. E(ENOENT, "No such file or directory") \
  12. E(ESRCH, "No such process") \
  13. E(EINTR, "Interrupted syscall") \
  14. E(EIO, "I/O error") \
  15. E(ENXIO, "No such device or address") \
  16. E(E2BIG, "Argument list too long") \
  17. E(ENOEXEC, "Exec format error") \
  18. E(EBADF, "Bad fd number") \
  19. E(ECHILD, "No child processes") \
  20. E(EAGAIN, "Try again") \
  21. E(ENOMEM, "Out of memory") \
  22. E(EACCES, "Permission denied") \
  23. E(EFAULT, "Bad address") \
  24. E(ENOTBLK, "Block device required") \
  25. E(EBUSY, "Device or resource busy") \
  26. E(EEXIST, "File already exists") \
  27. E(EXDEV, "Cross-device link") \
  28. E(ENODEV, "No such device") \
  29. E(ENOTDIR, "Not a directory") \
  30. E(EISDIR, "Is a directory") \
  31. E(EINVAL, "Invalid argument") \
  32. E(ENFILE, "File table overflow") \
  33. E(EMFILE, "Too many open files") \
  34. E(ENOTTY, "Not a TTY") \
  35. E(ETXTBSY, "Text file busy") \
  36. E(EFBIG, "File too large") \
  37. E(ENOSPC, "No space left on device") \
  38. E(ESPIPE, "Illegal seek") \
  39. E(EROFS, "Read-only filesystem") \
  40. E(EMLINK, "Too many links") \
  41. E(EPIPE, "Broken pipe") \
  42. E(ERANGE, "Range error") \
  43. E(ENAMETOOLONG, "Name too long") \
  44. E(ELOOP, "Too many symlinks") \
  45. E(EOVERFLOW, "Overflow") \
  46. E(EOPNOTSUPP, "Operation not supported") \
  47. E(ENOSYS, "No such syscall") \
  48. E(ENOTIMPL, "Not implemented") \
  49. E(EAFNOSUPPORT, "Address family not supported") \
  50. E(ENOTSOCK, "Not a socket") \
  51. E(EADDRINUSE, "Address in use") \
  52. E(ENOTEMPTY, "Directory not empty") \
  53. E(EDOM, "Math argument out of domain") \
  54. E(ECONNREFUSED, "Connection refused") \
  55. E(EHOSTDOWN, "Host is down") \
  56. E(EADDRNOTAVAIL, "Address not available") \
  57. E(EISCONN, "Already connected") \
  58. E(ECONNABORTED, "Connection aborted") \
  59. E(EALREADY, "Connection already in progress") \
  60. E(ECONNRESET, "Connection reset") \
  61. E(EDESTADDRREQ, "Destination address required") \
  62. E(EHOSTUNREACH, "Host unreachable") \
  63. E(EILSEQ, "Illegal byte sequence") \
  64. E(EMSGSIZE, "Message size") \
  65. E(ENETDOWN, "Network down") \
  66. E(ENETUNREACH, "Network unreachable") \
  67. E(ENETRESET, "Network reset") \
  68. E(ENOBUFS, "No buffer space") \
  69. E(ENOLCK, "No lock available") \
  70. E(ENOMSG, "No message") \
  71. E(ENOPROTOOPT, "No protocol option") \
  72. E(ENOTCONN, "Not connected") \
  73. E(ESHUTDOWN, "Transport endpoint has shutdown") \
  74. E(ETOOMANYREFS, "Too many references") \
  75. E(ESOCKTNOSUPPORT, "Socket type not supported") \
  76. E(EPROTONOSUPPORT, "Protocol not supported") \
  77. E(EDEADLK, "Resource deadlock would occur") \
  78. E(ETIMEDOUT, "Timed out") \
  79. E(EPROTOTYPE, "Wrong protocol type") \
  80. E(EINPROGRESS, "Operation in progress") \
  81. E(ENOTHREAD, "No such thread") \
  82. E(EPROTO, "Protocol error") \
  83. E(ENOTSUP, "Not supported") \
  84. E(EPFNOSUPPORT, "Protocol family not supported") \
  85. E(EDIRINTOSELF, "Cannot make directory a subdirectory of itself") \
  86. E(EDQUOT, "Quota exceeded") \
  87. E(ENOTRECOVERABLE, "State not recoverable") \
  88. E(ECANCELED, "Operation cancelled") \
  89. E(EPROMISEVIOLATION, "The process has a promise violation") \
  90. E(ESTALE, "Stale network file handle") \
  91. E(EMAXERRNO, "The highest errno +1 :^)")
  92. enum ErrnoCode {
  93. #define __ENUMERATE_ERRNO_CODE(c, s) c,
  94. ENUMERATE_ERRNO_CODES(__ENUMERATE_ERRNO_CODE)
  95. #undef __ENUMERATE_ERRNO_CODE
  96. };