Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
4.1 KiB

  1. /***
  2. *syserr.c - system error list
  3. *
  4. * Copyright (c) 1987-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines the System Error List, containing the full messages for
  8. * all errno values set by the library routines.
  9. * Defines sys_errlist, sys_nerr.
  10. *
  11. *Revision History:
  12. * 08-07-87 PHG removed obsolete definition of sys_msgmax.
  13. * 04-06-90 GJF Added #include <cruntime.h>. Also, fixed the copyright.
  14. * 01-21-91 GJF ANSI naming.
  15. * 07-11-91 JCR Changed "core" to "memory" in ENOMEM message
  16. * 01-23-92 GJF Added #include <stdlib.h> (contains decl of sys_nerr).
  17. * 09-30-92 GJF Made POSIX compatible. Non-POSIX errno values are
  18. * mapped to "Unknown error" for now. Next step is to
  19. * delete these and renumber to eliminate the gaps, after
  20. * the beta release.
  21. * 04-08-93 CFW Added EILSEQ (42) message.
  22. * 02-22-95 CFW Mac merge.
  23. * 06-14-95 CFW Change "Error 0" to "No Error" for Mac.
  24. * 05-17-99 PML Remove all Macintosh support.
  25. *
  26. *******************************************************************************/
  27. #include <cruntime.h>
  28. #include <stdlib.h>
  29. #ifdef _WIN32
  30. char *_sys_errlist[] =
  31. {
  32. /* 0 */ "No error",
  33. /* 1 EPERM */ "Operation not permitted",
  34. /* 2 ENOENT */ "No such file or directory",
  35. /* 3 ESRCH */ "No such process",
  36. /* 4 EINTR */ "Interrupted function call",
  37. /* 5 EIO */ "Input/output error",
  38. /* 6 ENXIO */ "No such device or address",
  39. /* 7 E2BIG */ "Arg list too long",
  40. /* 8 ENOEXEC */ "Exec format error",
  41. /* 9 EBADF */ "Bad file descriptor",
  42. /* 10 ECHILD */ "No child processes",
  43. /* 11 EAGAIN */ "Resource temporarily unavailable",
  44. /* 12 ENOMEM */ "Not enough space",
  45. /* 13 EACCES */ "Permission denied",
  46. /* 14 EFAULT */ "Bad address",
  47. /* 15 ENOTBLK */ "Unknown error", /* not POSIX */
  48. /* 16 EBUSY */ "Resource device",
  49. /* 17 EEXIST */ "File exists",
  50. /* 18 EXDEV */ "Improper link",
  51. /* 19 ENODEV */ "No such device",
  52. /* 20 ENOTDIR */ "Not a directory",
  53. /* 21 EISDIR */ "Is a directory",
  54. /* 22 EINVAL */ "Invalid argument",
  55. /* 23 ENFILE */ "Too many open files in system",
  56. /* 24 EMFILE */ "Too many open files",
  57. /* 25 ENOTTY */ "Inappropriate I/O control operation",
  58. /* 26 ETXTBSY */ "Unknown error", /* not POSIX */
  59. /* 27 EFBIG */ "File too large",
  60. /* 28 ENOSPC */ "No space left on device",
  61. /* 29 ESPIPE */ "Invalid seek",
  62. /* 30 EROFS */ "Read-only file system",
  63. /* 31 EMLINK */ "Too many links",
  64. /* 32 EPIPE */ "Broken pipe",
  65. /* 33 EDOM */ "Domain error",
  66. /* 34 ERANGE */ "Result too large",
  67. /* 35 EUCLEAN */ "Unknown error", /* not POSIX */
  68. /* 36 EDEADLK */ "Resource deadlock avoided",
  69. /* 37 UNKNOWN */ "Unknown error",
  70. /* 38 ENAMETOOLONG */ "Filename too long",
  71. /* 39 ENOLCK */ "No locks available",
  72. /* 40 ENOSYS */ "Function not implemented",
  73. /* 41 ENOTEMPTY */ "Directory not empty",
  74. /* 42 EILSEQ */ "Illegal byte sequence",
  75. /* 43 */ "Unknown error"
  76. };
  77. #else /* _WIN32 */
  78. #error ERROR - ONLY WIN32 TARGET SUPPORTED!
  79. #endif /* _WIN32 */
  80. int _sys_nerr = sizeof( _sys_errlist ) / sizeof( _sys_errlist[ 0 ] ) - 1;
  81. /* The above array contains all the errors including unknown error # 37
  82. which is used if msg_num is unknown */
  83. /* ***NOTE: Parameter _SYS_MSGMAX (in file syserr.h) indicates the length of
  84. the longest systerm error message in the above table. When you add or
  85. modify a message, you must update the value _SYS_MSGMAX, if appropriate. */