1 /* Errors <errno.h>
2 
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6 
7 #ifndef _PDCLIB_ERRNO_H
8 #define _PDCLIB_ERRNO_H _PDCLIB_ERRNO_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "pdclib/_PDCLIB_lib_ext1.h"
15 #include "pdclib/_PDCLIB_internal.h"
16 
17 /* FIXME: With <threads.h>, this needs to be in thread-specific storage. */
18 #define errno (*_PDCLIB_errno_func())
19 
20 /* C only requires the following three */
21 
22 /* Result too large */
23 #define ERANGE          _PDCLIB_ERANGE
24 /* Mathematics argument out of domain of function */
25 #define EDOM            _PDCLIB_EDOM
26 /* Illegal byte sequence */
27 #define EILSEQ          _PDCLIB_EILSEQ
28 
29 /* C++ additionally requires the folloing */
30 
31 /* Argument list too long */
32 #define E2BIG           _PDCLIB_E2BIG
33 /* Permission denied */
34 #define EACCES          _PDCLIB_EACCES
35 /* Address in use */
36 #define EADDRINUSE      _PDCLIB_EADDRINUSE
37 /* Address not available */
38 #define EADDRNOTAVAIL   _PDCLIB_EADDRNOTAVAIL
39 /* Address family not supported */
40 #define EAFNOSUPPORT    _PDCLIB_EAFNOSUPPORT
41 /* Resource unavailable, try again */
42 #define EAGAIN          _PDCLIB_EAGAIN
43 /* Connection already in progress */
44 #define EALREADY        _PDCLIB_EALREADY
45 /* Bad file descriptor */
46 #define EBADF           _PDCLIB_EBADF
47 /* Bad message */
48 #define EBADMSG         _PDCLIB_EBADMSG
49 /* Device or resource busy */
50 #define EBUSY           _PDCLIB_EBUSY
51 /* Operation canceled */
52 #define ECANCELED       _PDCLIB_ECANCELED
53 /* No child processes */
54 #define ECHILD          _PDCLIB_ECHILD
55 /* Connection aborted */
56 #define ECONNABORTED    _PDCLIB_ECONNABORTED
57 /* Connection refused */
58 #define ECONNREFUSED    _PDCLIB_ECONNREFUSED
59 /* Connection reset */
60 #define ECONNRESET      _PDCLIB_ECONNRESET
61 /* Resource deadlock would occur */
62 #define EDEADLK         _PDCLIB_EDEADLK
63 /* Destination address required */
64 #define EDESTADDRREQ    _PDCLIB_EDESTADDRREQ
65 /* File exists */
66 #define EEXIST          _PDCLIB_EEXIST
67 /* Bad address */
68 #define EFAULT          _PDCLIB_EFAULT
69 /* File too large */
70 #define EFBIG           _PDCLIB_EFBIG
71 /* Host is unreachable */
72 #define EHOSTUNREACH    _PDCLIB_EHOSTUNREACH
73 /* Identifier removed */
74 #define EIDRM           _PDCLIB_EIDRM
75 /* Operation in progress */
76 #define EINPROGRESS     _PDCLIB_EINPROGRESS
77 /* Interrupted function */
78 #define EINTR           _PDCLIB_EINTR
79 /* Invalid argument */
80 #define EINVAL          _PDCLIB_EINVAL
81 /* I/O error */
82 #define EIO             _PDCLIB_EIO
83 /* Socket is connected */
84 #define EISCONN         _PDCLIB_EISCONN
85 /* Is a directory */
86 #define EISDIR          _PDCLIB_EISDIR
87 /* Too many levels of symbolic links */
88 #define ELOOP           _PDCLIB_ELOOP
89 /* File descriptor value too large */
90 #define EMFILE          _PDCLIB_EMFILE
91 /* Too many links */
92 #define EMLINK          _PDCLIB_EMLINK
93 /* Message too large */
94 #define EMSGSIZE        _PDCLIB_EMSGSIZE
95 /* Filename too long */
96 #define ENAMETOOLONG    _PDCLIB_ENAMETOOLONG
97 /* Network is down */
98 #define ENETDOWN        _PDCLIB_ENETDOWN
99 /* Connection aborted by network */
100 #define ENETRESET       _PDCLIB_ENETRESET
101 /* Network unreachable */
102 #define ENETUNREACH     _PDCLIB_ENETUNREACH
103 /* Too many files open in system */
104 #define ENFILE          _PDCLIB_ENFILE
105 /* No buffer space available */
106 #define ENOBUFS         _PDCLIB_ENOBUFS
107 /* No message is available on the STREAM head read queue */
108 #define ENODATA         _PDCLIB_ENODATA
109 /* No such device */
110 #define ENODEV          _PDCLIB_ENODEV
111 /* No such file or directory */
112 #define ENOENT          _PDCLIB_ENOENT
113 /* Executable file format error */
114 #define ENOEXEC         _PDCLIB_ENOEXEC
115 /* No locks available */
116 #define ENOLCK          _PDCLIB_ENOLCK
117 /* Link has been severed */
118 #define ENOLINK         _PDCLIB_ENOLINK
119 /* Not enough space */
120 #define ENOMEM          _PDCLIB_ENOMEM
121 /* No message of the desired type */
122 #define ENOMSG          _PDCLIB_ENOMSG
123 /* Protocol not available */
124 #define ENOPROTOOPT     _PDCLIB_ENOPROTOOPT
125 /* No space left on device */
126 #define ENOSPC          _PDCLIB_ENOSPC
127 /* No STREAM resources */
128 #define ENOSR           _PDCLIB_ENOSR
129 /* Not a STREAM */
130 #define ENOSTR          _PDCLIB_ENOSTR
131 /* Function not supported */
132 #define ENOSYS          _PDCLIB_ENOSYS
133 /* The socket is not connected */
134 #define ENOTCONN        _PDCLIB_ENOTCONN
135 /* Not a directory */
136 #define ENOTDIR         _PDCLIB_ENOTDIR
137 /* Directory not empty */
138 #define ENOTEMPTY       _PDCLIB_ENOTEMPTY
139 /* State not recoverable */
140 #define ENOTRECOVERABLE _PDCLIB_ENOTRECOVERABLE
141 /* Not a socket */
142 #define ENOTSOCK        _PDCLIB_ENOTSOCK
143 /* Not supported */
144 #define ENOTSUP         _PDCLIB_ENOTSUP
145 /* Inappropriate I/O control operation */
146 #define ENOTTY          _PDCLIB_ENOTTY
147 /* No such device or address */
148 #define ENXIO           _PDCLIB_ENXIO
149 /* Operation not supported on socket */
150 #define EOPNOTSUPP      _PDCLIB_EOPNOTSUPP
151 /* Value too large to be stored in data type */
152 #define EOVERFLOW       _PDCLIB_EOVERFLOW
153 /* Previous owner died */
154 #define EOWNERDEAD      _PDCLIB_EOWNERDEAD
155 /* Operation not permitted */
156 #define EPERM           _PDCLIB_EPERM
157 /* Broken pipe */
158 #define EPIPE           _PDCLIB_EPIPE
159 /* Protocol error */
160 #define EPROTO          _PDCLIB_EPROTO
161 /* Protocol not supported */
162 #define EPROTONOSUPPORT _PDCLIB_EPROTONOSUPPORT
163 /* Protocol wrong type for socket */
164 #define EPROTOTYPE      _PDCLIB_EPROTOTYPE
165 /* Read-only file system */
166 #define EROFS           _PDCLIB_EROFS
167 /* Invalid seek */
168 #define ESPIPE          _PDCLIB_ESPIPE
169 /* No such process */
170 #define ESRCH           _PDCLIB_ESRCH
171 /* Stream ioctl() timeout */
172 #define ETIME           _PDCLIB_ETIME
173 /* Connection timed out */
174 #define ETIMEDOUT       _PDCLIB_ETIMEDOUT
175 /* Text file busy */
176 #define ETXTBSY         _PDCLIB_ETXTBSY
177 /* Operation would block */
178 #define EWOULDBLOCK     _PDCLIB_EWOULDBLOCK
179 /* Cross-device link */
180 #define EXDEV           _PDCLIB_EXDEV
181 
182 /* Annex K -- Bounds-checking interfaces */
183 
184 #if ( __STDC_WANT_LIB_EXT1__ + 0 ) != 0
185 #ifndef _PDCLIB_ERRNO_T_DEFINED
186 #define _PDCLIB_ERRNO_T_DEFINED _PDCLIB_ERRNO_T_DEFINED
187 typedef int errno_t;
188 #endif
189 #endif
190 
191 /* Extension hook for downstream projects that want to have non-standard
192    extensions to standard headers.
193 */
194 #ifdef _PDCLIB_EXTEND_ERRNO_H
195 #include _PDCLIB_EXTEND_ERRNO_H
196 #endif
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif
203