xref: /reactos/sdk/include/ucrt/errno.h (revision 04e0dc4a)
1 //
2 // errno.h
3 //
4 //      Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // System error numbers for use with errno and errno_t.
7 //
8 #pragma once
9 #ifndef _INC_ERRNO // include guard for 3rd party interop
10 #define _INC_ERRNO
11 
12 #include <corecrt.h>
13 
14 #pragma warning(push)
15 #pragma warning(disable: _UCRT_DISABLED_WARNINGS)
16 _UCRT_DISABLE_CLANG_WARNINGS
17 
18 _CRT_BEGIN_C_HEADER
19 
20 
21 
22 #if _CRT_FUNCTIONS_REQUIRED
23     _ACRTIMP int* __cdecl _errno(void);
24     #define errno (*_errno())
25 
26     _ACRTIMP errno_t __cdecl _set_errno(_In_ int _Value);
27     _ACRTIMP errno_t __cdecl _get_errno(_Out_ int* _Value);
28 
29     _ACRTIMP unsigned long* __cdecl __doserrno(void);
30     #define _doserrno (*__doserrno())
31 
32     _ACRTIMP errno_t __cdecl _set_doserrno(_In_ unsigned long _Value);
33     _ACRTIMP errno_t __cdecl _get_doserrno(_Out_ unsigned long * _Value);
34 #endif // _CRT_FUNCTIONS_REQUIRED
35 
36 
37 
38 // Error codes
39 #define EPERM           1
40 #define ENOENT          2
41 #define ESRCH           3
42 #define EINTR           4
43 #define EIO             5
44 #define ENXIO           6
45 #define E2BIG           7
46 #define ENOEXEC         8
47 #define EBADF           9
48 #define ECHILD          10
49 #define EAGAIN          11
50 #define ENOMEM          12
51 #define EACCES          13
52 #define EFAULT          14
53 #define EBUSY           16
54 #define EEXIST          17
55 #define EXDEV           18
56 #define ENODEV          19
57 #define ENOTDIR         20
58 #define EISDIR          21
59 #define ENFILE          23
60 #define EMFILE          24
61 #define ENOTTY          25
62 #define EFBIG           27
63 #define ENOSPC          28
64 #define ESPIPE          29
65 #define EROFS           30
66 #define EMLINK          31
67 #define EPIPE           32
68 #define EDOM            33
69 #define EDEADLK         36
70 #define ENAMETOOLONG    38
71 #define ENOLCK          39
72 #define ENOSYS          40
73 #define ENOTEMPTY       41
74 
75 // Error codes used in the Secure CRT functions
76 #ifndef RC_INVOKED
77     #define _SECURECRT_ERRCODE_VALUES_DEFINED
78     #define EINVAL          22
79     #define ERANGE          34
80     #define EILSEQ          42
81     #define STRUNCATE       80
82 #endif
83 
84 // Support EDEADLOCK for compatibility with older Microsoft C versions
85 #define EDEADLOCK       EDEADLK
86 
87 // POSIX Supplement
88 #ifndef _CRT_NO_POSIX_ERROR_CODES
89     #define EADDRINUSE      100
90     #define EADDRNOTAVAIL   101
91     #define EAFNOSUPPORT    102
92     #define EALREADY        103
93     #define EBADMSG         104
94     #define ECANCELED       105
95     #define ECONNABORTED    106
96     #define ECONNREFUSED    107
97     #define ECONNRESET      108
98     #define EDESTADDRREQ    109
99     #define EHOSTUNREACH    110
100     #define EIDRM           111
101     #define EINPROGRESS     112
102     #define EISCONN         113
103     #define ELOOP           114
104     #define EMSGSIZE        115
105     #define ENETDOWN        116
106     #define ENETRESET       117
107     #define ENETUNREACH     118
108     #define ENOBUFS         119
109     #define ENODATA         120
110     #define ENOLINK         121
111     #define ENOMSG          122
112     #define ENOPROTOOPT     123
113     #define ENOSR           124
114     #define ENOSTR          125
115     #define ENOTCONN        126
116     #define ENOTRECOVERABLE 127
117     #define ENOTSOCK        128
118     #define ENOTSUP         129
119     #define EOPNOTSUPP      130
120     #define EOTHER          131
121     #define EOVERFLOW       132
122     #define EOWNERDEAD      133
123     #define EPROTO          134
124     #define EPROTONOSUPPORT 135
125     #define EPROTOTYPE      136
126     #define ETIME           137
127     #define ETIMEDOUT       138
128     #define ETXTBSY         139
129     #define EWOULDBLOCK     140
130 #endif // _CRT_NO_POSIX_ERROR_CODES
131 
132 
133 
134 _CRT_END_C_HEADER
135 _UCRT_RESTORE_CLANG_WARNINGS
136 #pragma warning(pop) // _UCRT_DISABLED_WARNINGS
137 #endif // _INC_ERRNO
138