1 |
39 |
lampret |
/* errno is not a global variable, because that would make using it
|
2 |
|
|
non-reentrant. Instead, its address is returned by the function
|
3 |
|
|
__errno. */
|
4 |
|
|
|
5 |
|
|
#ifndef _SYS_ERRNO_H_
|
6 |
|
|
#ifdef __cplusplus
|
7 |
|
|
extern "C" {
|
8 |
|
|
#endif
|
9 |
|
|
#define _SYS_ERRNO_H_
|
10 |
|
|
|
11 |
|
|
#include <sys/reent.h>
|
12 |
|
|
|
13 |
|
|
#ifndef _REENT_ONLY
|
14 |
|
|
#define errno (*__errno())
|
15 |
|
|
extern int *__errno _PARAMS ((void));
|
16 |
|
|
#endif
|
17 |
|
|
|
18 |
56 |
joel |
#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__)
|
19 |
|
|
extern _CONST char * _CONST _sys_errlist[];
|
20 |
|
|
extern int _sys_nerr;
|
21 |
|
|
#else
|
22 |
|
|
extern _CONST char * _CONST _sys_errlist[] __declspec(dllimport);
|
23 |
|
|
extern int _sys_nerr __declspec(dllimport);
|
24 |
|
|
#endif
|
25 |
|
|
|
26 |
39 |
lampret |
#define __errno_r(ptr) ((ptr)->_errno)
|
27 |
|
|
|
28 |
|
|
#define EPERM 1 /* Not super-user */
|
29 |
|
|
#define ENOENT 2 /* No such file or directory */
|
30 |
|
|
#define ESRCH 3 /* No such process */
|
31 |
|
|
#define EINTR 4 /* Interrupted system call */
|
32 |
|
|
#define EIO 5 /* I/O error */
|
33 |
|
|
#define ENXIO 6 /* No such device or address */
|
34 |
|
|
#define E2BIG 7 /* Arg list too long */
|
35 |
|
|
#define ENOEXEC 8 /* Exec format error */
|
36 |
|
|
#define EBADF 9 /* Bad file number */
|
37 |
|
|
#define ECHILD 10 /* No children */
|
38 |
|
|
#define EAGAIN 11 /* No more processes */
|
39 |
|
|
#define ENOMEM 12 /* Not enough core */
|
40 |
|
|
#define EACCES 13 /* Permission denied */
|
41 |
|
|
#define EFAULT 14 /* Bad address */
|
42 |
|
|
#define ENOTBLK 15 /* Block device required */
|
43 |
|
|
#define EBUSY 16 /* Mount device busy */
|
44 |
|
|
#define EEXIST 17 /* File exists */
|
45 |
|
|
#define EXDEV 18 /* Cross-device link */
|
46 |
|
|
#define ENODEV 19 /* No such device */
|
47 |
|
|
#define ENOTDIR 20 /* Not a directory */
|
48 |
|
|
#define EISDIR 21 /* Is a directory */
|
49 |
|
|
#define EINVAL 22 /* Invalid argument */
|
50 |
|
|
#define ENFILE 23 /* Too many open files in system */
|
51 |
|
|
#define EMFILE 24 /* Too many open files */
|
52 |
|
|
#define ENOTTY 25 /* Not a typewriter */
|
53 |
|
|
#define ETXTBSY 26 /* Text file busy */
|
54 |
|
|
#define EFBIG 27 /* File too large */
|
55 |
|
|
#define ENOSPC 28 /* No space left on device */
|
56 |
|
|
#define ESPIPE 29 /* Illegal seek */
|
57 |
|
|
#define EROFS 30 /* Read only file system */
|
58 |
|
|
#define EMLINK 31 /* Too many links */
|
59 |
|
|
#define EPIPE 32 /* Broken pipe */
|
60 |
|
|
#define EDOM 33 /* Math arg out of domain of func */
|
61 |
|
|
#define ERANGE 34 /* Math result not representable */
|
62 |
|
|
#define ENOMSG 35 /* No message of desired type */
|
63 |
|
|
#define EIDRM 36 /* Identifier removed */
|
64 |
|
|
#define ECHRNG 37 /* Channel number out of range */
|
65 |
|
|
#define EL2NSYNC 38 /* Level 2 not synchronized */
|
66 |
|
|
#define EL3HLT 39 /* Level 3 halted */
|
67 |
|
|
#define EL3RST 40 /* Level 3 reset */
|
68 |
|
|
#define ELNRNG 41 /* Link number out of range */
|
69 |
|
|
#define EUNATCH 42 /* Protocol driver not attached */
|
70 |
|
|
#define ENOCSI 43 /* No CSI structure available */
|
71 |
|
|
#define EL2HLT 44 /* Level 2 halted */
|
72 |
|
|
#define EDEADLK 45 /* Deadlock condition */
|
73 |
|
|
#define ENOLCK 46 /* No record locks available */
|
74 |
|
|
#define EBADE 50 /* Invalid exchange */
|
75 |
|
|
#define EBADR 51 /* Invalid request descriptor */
|
76 |
|
|
#define EXFULL 52 /* Exchange full */
|
77 |
|
|
#define ENOANO 53 /* No anode */
|
78 |
|
|
#define EBADRQC 54 /* Invalid request code */
|
79 |
|
|
#define EBADSLT 55 /* Invalid slot */
|
80 |
|
|
#define EDEADLOCK 56 /* File locking deadlock error */
|
81 |
|
|
#define EBFONT 57 /* Bad font file fmt */
|
82 |
|
|
#define ENOSTR 60 /* Device not a stream */
|
83 |
|
|
#define ENODATA 61 /* No data (for no delay io) */
|
84 |
|
|
#define ETIME 62 /* Timer expired */
|
85 |
|
|
#define ENOSR 63 /* Out of streams resources */
|
86 |
|
|
#define ENONET 64 /* Machine is not on the network */
|
87 |
|
|
#define ENOPKG 65 /* Package not installed */
|
88 |
|
|
#define EREMOTE 66 /* The object is remote */
|
89 |
|
|
#define ENOLINK 67 /* The link has been severed */
|
90 |
|
|
#define EADV 68 /* Advertise error */
|
91 |
|
|
#define ESRMNT 69 /* Srmount error */
|
92 |
|
|
#define ECOMM 70 /* Communication error on send */
|
93 |
|
|
#define EPROTO 71 /* Protocol error */
|
94 |
|
|
#define EMULTIHOP 74 /* Multihop attempted */
|
95 |
|
|
#define ELBIN 75 /* Inode is remote (not really error) */
|
96 |
|
|
#define EDOTDOT 76 /* Cross mount point (not really error) */
|
97 |
|
|
#define EBADMSG 77 /* Trying to read unreadable message */
|
98 |
|
|
#define ENOTUNIQ 80 /* Given log. name not unique */
|
99 |
|
|
#define EBADFD 81 /* f.d. invalid for this operation */
|
100 |
|
|
#define EREMCHG 82 /* Remote address changed */
|
101 |
|
|
#define ELIBACC 83 /* Can't access a needed shared lib */
|
102 |
|
|
#define ELIBBAD 84 /* Accessing a corrupted shared lib */
|
103 |
|
|
#define ELIBSCN 85 /* .lib section in a.out corrupted */
|
104 |
|
|
#define ELIBMAX 86 /* Attempting to link in too many libs */
|
105 |
|
|
#define ELIBEXEC 87 /* Attempting to exec a shared library */
|
106 |
|
|
#define ENOSYS 88 /* Function not implemented */
|
107 |
|
|
#define ENMFILE 89 /* No more files */
|
108 |
|
|
#define ENOTEMPTY 90 /* Directory not empty */
|
109 |
|
|
#define ENAMETOOLONG 91 /* File or path name too long */
|
110 |
|
|
#define ELOOP 92 /* Too many symbolic links */
|
111 |
|
|
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
112 |
|
|
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
113 |
|
|
#define ECONNRESET 104 /* Connection reset by peer */
|
114 |
|
|
#define ENOBUFS 105 /* No buffer space available */
|
115 |
59 |
joel |
#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
|
116 |
|
|
#define EPROTOTYPE 107 /* Protocol wrong type for socket */
|
117 |
|
|
#define ENOTSOCK 108 /* Socket operation on non-socket */
|
118 |
|
|
#define ENOPROTOOPT 109 /* Protocol not available */
|
119 |
|
|
#define ESHUTDOWN 110 /* Can't send after socket shutdown */
|
120 |
39 |
lampret |
#define ECONNREFUSED 111 /* Connection refused */
|
121 |
|
|
#define EADDRINUSE 112 /* Address already in use */
|
122 |
59 |
joel |
#define ECONNABORTED 113 /* Software caused connection abort */
|
123 |
|
|
#define ENETUNREACH 114 /* Network is unreachable */
|
124 |
|
|
#define ENETDOWN 115 /* Network interface is not configured */
|
125 |
|
|
#define ETIMEDOUT 116 /* Connection timed out */
|
126 |
|
|
#define EHOSTDOWN 117 /* Host is down */
|
127 |
|
|
#define EHOSTUNREACH 118 /* Host is unreachable */
|
128 |
|
|
#define EINPROGRESS 119 /* Connection already in progress */
|
129 |
|
|
#define EALREADY 120 /* Socket already connected */
|
130 |
|
|
#define EDESTADDRREQ 121 /* Destination address required */
|
131 |
|
|
#define EMSGSIZE 122 /* Message too long */
|
132 |
|
|
#define EPROTONOSUPPORT 123 /* Unknown protocol */
|
133 |
|
|
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
|
134 |
|
|
#define EADDRNOTAVAIL 125 /* Address not available */
|
135 |
39 |
lampret |
#define ENETRESET 126
|
136 |
59 |
joel |
#define EISCONN 127 /* Socket is already connected */
|
137 |
|
|
#define ENOTCONN 128 /* Socket is not connected */
|
138 |
39 |
lampret |
#define ETOOMANYREFS 129
|
139 |
|
|
#define EPROCLIM 130
|
140 |
|
|
#define EUSERS 131
|
141 |
|
|
#define EDQUOT 132
|
142 |
|
|
#define ESTALE 133
|
143 |
59 |
joel |
#define ENOTSUP 134 /* Not supported */
|
144 |
56 |
joel |
#define ENOMEDIUM 135
|
145 |
39 |
lampret |
|
146 |
|
|
/* From cygwin32. */
|
147 |
|
|
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
148 |
|
|
|
149 |
|
|
#define __ELASTERROR 2000 /* Users can add values starting here */
|
150 |
|
|
|
151 |
|
|
#ifdef __cplusplus
|
152 |
|
|
}
|
153 |
|
|
#endif
|
154 |
|
|
#endif /* _SYS_ERRNO_H */
|