errmsg.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008
  3. * The President and Fellows of Harvard College.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #ifndef _KERN_ERRMSG_H_
  30. #define _KERN_ERRMSG_H_
  31. /*
  32. * Error strings.
  33. * This table must agree with kern/errno.h.
  34. *
  35. * Note that since this actually defines sys_errlist and sys_nerrlist, it
  36. * should only be included in one file. For the kernel, that file is
  37. * lib/misc.c; for userland it's lib/libc/strerror.c.
  38. */
  39. const char *const sys_errlist[] = {
  40. "Operation succeeded", /* 0 */
  41. "No such system call", /* ENOSYS */
  42. "Unimplemented feature", /* EUNIMP */
  43. "Out of memory", /* ENOMEM */
  44. "Operation would block", /* EAGAIN (also EWOULDBLOCK) */
  45. "Interrupted system call", /* EINTR */
  46. "Bad memory reference", /* EFAULT */
  47. "String too long", /* ENAMETOOLONG */
  48. "Invalid argument", /* EINVAL */
  49. "Operation not permitted", /* EPERM */
  50. "Permission denied", /* EACCES */
  51. "Too many processes", /* EMPROC (EPROCLIM in Unix) */
  52. "Too many processes in system",/* ENPROC */
  53. "File is not executable", /* ENOEXEC */
  54. "Argument list too long", /* E2BIG */
  55. "No such process", /* ESRCH */
  56. "No child processes", /* ECHILD */
  57. "Not a directory", /* ENOTDIR */
  58. "Is a directory", /* EISDIR */
  59. "No such file or directory", /* ENOENT */
  60. "Too many levels of symbolic links",/* ELOOP */
  61. "Directory not empty", /* ENOTEMPTY */
  62. "File or object exists", /* EEXIST */
  63. "Too many hard links", /* EMLINK */
  64. "Cross-device link", /* EXDEV */
  65. "No such device", /* ENODEV */
  66. "Device not available", /* ENXIO */
  67. "Device or resource busy", /* EBUSY */
  68. "Too many open files", /* EMFILE */
  69. "Too many open files in system",/* ENFILE */
  70. "Bad file number", /* EBADF */
  71. "Invalid or inappropriate ioctl",/* EIOCTL (ENOTTY in Unix) */
  72. "Input/output error", /* EIO */
  73. "Illegal seek", /* ESPIPE */
  74. "Broken pipe", /* EPIPE */
  75. "Read-only file system", /* EROFS */
  76. "No space left on device", /* ENOSPC */
  77. "Disc quota exceeded", /* EDQUOT */
  78. "File too large", /* EFBIG */
  79. "Invalid file type or format",/* EFTYPE */
  80. "Argument out of range", /* EDOM */
  81. "Result out of range", /* ERANGE */
  82. "Invalid multibyte character sequence",/* EILSEQ */
  83. "Not a socket", /* ENOTSOCK */
  84. "Is a socket", /* EISSOCK (EOPNOTSUPP in Unix) */
  85. "Socket is already connected",/* EISCONN */
  86. "Socket is not connected", /* ENOTCONN */
  87. "Socket has been shut down", /* ESHUTDOWN */
  88. "Protocol family not supported",/* EPFNOSUPPORT */
  89. "Socket type not supported", /* ESOCKTNOSUPPORT */
  90. "Protocol not supported", /* EPROTONOSUPPORT */
  91. "Protocol wrong type for socket",/* EPROTOTYPE */
  92. "Address family not supported by protocol family",/* EAFNOSUPPORT */
  93. "Protocol option not available",/* ENOPROTOOPT */
  94. "Address already in use", /* EADDRINUSE */
  95. "Cannot assign requested address",/* EADDRNOTAVAIL */
  96. "Network is down", /* ENETDOWN */
  97. "Network is unreachable", /* ENETUNREACH */
  98. "Host is down", /* EHOSTDOWN */
  99. "Host is unreachable", /* EHOSTUNREACH */
  100. "Connection refused", /* ECONNREFUSED */
  101. "Connection timed out", /* ETIMEDOUT */
  102. "Connection reset by peer", /* ECONNRESET */
  103. "Message too large", /* EMSGSIZE */
  104. "Threads operation not supported",/* ENOTSUP */
  105. };
  106. /*
  107. * Number of entries in sys_errlist.
  108. */
  109. const int sys_nerr = sizeof(sys_errlist)/sizeof(const char *);
  110. #endif /* _KERN_ERRMSG_H_ */