Skip to content

Commit 7a5b490

Browse files
authored
Add more errno defines for compatibility (#640)
List based on https://en.cppreference.com/w/cpp/header/cerrno.html Actual values not based on POSIX but that's neither a requirement nor what was done for existing `#define`s
1 parent 61f79f9 commit 7a5b490

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

src/libc/include/errno.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,81 @@
77
#define EDOM 4 /* math domain error */
88
#define ERANGE 5 /* math range error */
99

10+
// Not used, but defined for compatibility
11+
#define E2BIG 6 /* Argument list too long */
12+
#define EACCES 7 /* Permission denied */
13+
#define EADDRINUSE 8 /* Address in use */
14+
#define EADDRNOTAVAIL 9 /* Address not available */
15+
#define EAFNOSUPPORT 10 /* Address family not supported */
16+
#define EAGAIN 11 /* Resource unavailable, try again */
17+
#define EALREADY 12 /* Connection already in progress */
18+
#define EBADF 13 /* Bad file descriptor */
19+
#define EBADMSG 14 /* Bad message */
20+
#define EBUSY 15 /* Device or resource busy */
21+
#define ECANCELED 16 /* Operation canceled */
22+
#define ECHILD 17 /* No child processes */
23+
#define ECONNABORTED 18 /* Connection aborted */
24+
#define ECONNREFUSED 19 /* Connection refused */
25+
#define ECONNRESET 20 /* Connection reset */
26+
#define EDEADLK 21 /* Resource deadlock avoided */
27+
#define EDESTADDRREQ 22 /* Destination address required */
28+
#define EEXIST 23 /* File exists */
29+
#define EFAULT 24 /* Bad address */
30+
#define EFBIG 25 /* File too large */
31+
#define EHOSTUNREACH 26 /* Host is unreachable */
32+
#define EIDRM 27 /* Identifier removed */
33+
#define EILSEQ 28 /* Illegal byte sequence */
34+
#define EINPROGRESS 29 /* Operation in progress */
35+
#define EINTR 30 /* Interrupted function */
36+
#define EISCONN 31 /* Socket is connected */
37+
#define EISDIR 32 /* Is a directory */
38+
#define ELOOP 33 /* Too many levels of symbolic links */
39+
#define EMFILE 34 /* Too many open files */
40+
#define EMLINK 35 /* Too many links */
41+
#define EMSGSIZE 36 /* Message too long */
42+
#define ENAMETOOLONG 37 /* Filename too long */
43+
#define ENETDOWN 38 /* Network is down */
44+
#define ENETRESET 39 /* Connection aborted by network */
45+
#define ENETUNREACH 40 /* Network is unreachable */
46+
#define ENFILE 41 /* Too many open files in system */
47+
#define ENOBUFS 42 /* No buffer space available */
48+
#define ENODATA 43 /* No message is available on the STREAM head read queue */
49+
#define ENODEV 44 /* No such device */
50+
#define ENOENT 45 /* No such file or directory */
51+
#define ENOEXEC 46 /* Executable file format error */
52+
#define ENOLCK 47 /* No locks available */
53+
#define ENOLINK 48 /* Link has been severed */
54+
#define ENOMEM 49 /* Not enough space */
55+
#define ENOMSG 50 /* No message of desired type */
56+
#define ENOPROTOOPT 51 /* Protocol not available */
57+
#define ENOSPC 52 /* No space left on device */
58+
#define ENOSR 53 /* No stream resources */
59+
#define ENOSTR 54 /* Not a stream */
60+
#define ENOSYS 55 /* Function not implemented */
61+
#define ENOTCONN 56 /* The socket is not connected */
62+
#define ENOTDIR 57 /* Not a directory */
63+
#define ENOTEMPTY 58 /* Directory not empty */
64+
#define ENOTRECOVERABLE 59 /* State not recoverable */
65+
#define ENOTSOCK 60 /* Not a socket */
66+
#define ENOTSUP 61 /* Not supported */
67+
#define ENOTTY 62 /* Inappropriate I/O control operation */
68+
#define ENXIO 63 /* No such device or address */
69+
#define EOPNOTSUPP 64 /* Operation not supported on socket */
70+
#define EOVERFLOW 65 /* Value too large to be stored in data type */
71+
#define EOWNERDEAD 66 /* Previous owner died */
72+
#define EPIPE 67 /* Broken pipe */
73+
#define EPROTO 68 /* Protocol error */
74+
#define EPROTONOSUPPORT 69 /* Protocol not supported */
75+
#define EPROTOTYPE 70 /* Protocol wrong type for socket */
76+
#define EROFS 71 /* Read-only file system */
77+
#define ESPIPE 72 /* Invalid seek */
78+
#define ESRCH 73 /* No such process */
79+
#define ETIME 74 /* Stream ioctl() timeout */
80+
#define ETIMEDOUT 75 /* Connection timed out */
81+
#define ETXTBSY 76 /* Text file busy */
82+
#define EWOULDBLOCK 77 /* Operation would block */
83+
#define EXDEV 78 /* Cross-device link */
84+
1085
extern int errno;
1186

1287
#endif /* _ERRNO_H */

0 commit comments

Comments
 (0)