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.

159 lines
4.9 KiB

  1. /***
  2. *errno.h - system wide error numbers (set by system calls)
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines the system-wide error numbers (set by
  8. * system calls). Conforms to the XENIX standard. Extended
  9. * for compatibility with Uniforum standard.
  10. * [System V]
  11. *
  12. * [Public]
  13. *
  14. *Revision History:
  15. * 07-15-88 JCR Added errno definition [ANSI]
  16. * 08-22-88 GJF Modified to also work with the 386 (small model only)
  17. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  18. * 08-01-89 GJF Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
  19. * 10-30-89 GJF Fixed copyright
  20. * 11-02-89 JCR Changed "DLL" to "_DLL"
  21. * 02-28-90 GJF Added #ifndef _INC_ERRNO and #include <cruntime.h>
  22. * stuff. Also, removed some (now) useless preprocessor
  23. * directives.
  24. * 03-29-90 GJF Replaced _cdecl with _CALLTYPE1 or _VARTYPE1, as
  25. * appropriate.
  26. * 08-16-90 SBM Made MTHREAD _errno() return int *
  27. * 08-20-91 JCR C++ and ANSI naming
  28. * 08-06-92 GJF Function calling type and variable type macros.
  29. * 10-01-92 GJF Made compatible with POSIX. Next step is to renumber
  30. * to remove gaps (after next beta).
  31. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  32. * 04-06-93 SKS Replace _CRTAPI1/2 with __cdecl, _CRTVAR1 with nothing
  33. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  34. * 04-08-93 CFW Added EILSEQ 42.
  35. * 09-01-93 GJF Merged Cuda and NT SDK versions.
  36. * 06-06-94 SKS Change if def(_MT) to if def(_MT) || def(_DLL)
  37. * This will support single-thread apps using MSVCRT*.DLL
  38. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  39. * 02-14-95 CFW Clean up Mac merge.
  40. * 12-14-95 JWM Add "#pragma once".
  41. * 02-20-97 GJF Cleaned out obsolete support for _CRTAPI* and _NTSDK.
  42. * Replaced !defined(_M_MPPC) && !defined(_M_M68K) with
  43. * !defined(_MAC). Also, detab-ed.
  44. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  45. * 10-07-97 RDL Added IA64.
  46. * 05-13-99 PML Remove _CRTAPI1
  47. * 05-17-99 PML Remove all Macintosh support.
  48. *
  49. ****/
  50. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  51. #pragma once
  52. #endif
  53. #ifndef _INC_ERRNO
  54. #define _INC_ERRNO
  55. #if !defined(_WIN32)
  56. #error ERROR: Only Win32 target supported!
  57. #endif
  58. #ifndef _CRTBLD
  59. /* This version of the header files is NOT for user programs.
  60. * It is intended for use when building the C runtimes ONLY.
  61. * The version intended for public use will not have this message.
  62. */
  63. #error ERROR: Use of C runtime library internal header file.
  64. #endif /* _CRTBLD */
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68. #ifndef _INTERNAL_IFSTRIP_
  69. #include <cruntime.h>
  70. #endif /* _INTERNAL_IFSTRIP_ */
  71. /* Define _CRTIMP */
  72. #ifndef _CRTIMP
  73. #ifdef CRTDLL
  74. #define _CRTIMP __declspec(dllexport)
  75. #else /* ndef CRTDLL */
  76. #ifdef _DLL
  77. #define _CRTIMP __declspec(dllimport)
  78. #else /* ndef _DLL */
  79. #define _CRTIMP
  80. #endif /* _DLL */
  81. #endif /* CRTDLL */
  82. #endif /* _CRTIMP */
  83. /* Define __cdecl for non-Microsoft compilers */
  84. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  85. #define __cdecl
  86. #endif
  87. /* declare reference to errno */
  88. #if defined(_MT) || defined(_DLL)
  89. _CRTIMP extern int * __cdecl _errno(void);
  90. #define errno (*_errno())
  91. #else /* ndef _MT && ndef _DLL */
  92. _CRTIMP extern int errno;
  93. #endif /* _MT || _DLL */
  94. /* Error Codes */
  95. #define EPERM 1
  96. #define ENOENT 2
  97. #define ESRCH 3
  98. #define EINTR 4
  99. #define EIO 5
  100. #define ENXIO 6
  101. #define E2BIG 7
  102. #define ENOEXEC 8
  103. #define EBADF 9
  104. #define ECHILD 10
  105. #define EAGAIN 11
  106. #define ENOMEM 12
  107. #define EACCES 13
  108. #define EFAULT 14
  109. #define EBUSY 16
  110. #define EEXIST 17
  111. #define EXDEV 18
  112. #define ENODEV 19
  113. #define ENOTDIR 20
  114. #define EISDIR 21
  115. #define EINVAL 22
  116. #define ENFILE 23
  117. #define EMFILE 24
  118. #define ENOTTY 25
  119. #define EFBIG 27
  120. #define ENOSPC 28
  121. #define ESPIPE 29
  122. #define EROFS 30
  123. #define EMLINK 31
  124. #define EPIPE 32
  125. #define EDOM 33
  126. #define ERANGE 34
  127. #define EDEADLK 36
  128. #define ENAMETOOLONG 38
  129. #define ENOLCK 39
  130. #define ENOSYS 40
  131. #define ENOTEMPTY 41
  132. #define EILSEQ 42
  133. /*
  134. * Support EDEADLOCK for compatibiity with older MS-C versions.
  135. */
  136. #define EDEADLOCK EDEADLK
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif /* _INC_ERRNO */