Commit 637947f19dd2d72a0ecb2dfd6c946b8ffeabe765
1 parent
c12ab05c
linux-user errno mapping, by Stuart Anderson.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2908 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
455 additions
and
1 deletions
linux-user/errno_defs.h
0 → 100644
1 | +/* | |
2 | + * Target definitions of errnos. These may be overridden by an | |
3 | + * architecture specific header if needed. | |
4 | + * | |
5 | + * Taken from asm-generic/errno-base.h and asm-generic/errno.h | |
6 | + */ | |
7 | +#define TARGET_EPERM 1 /* Operation not permitted */ | |
8 | +#define TARGET_ENOENT 2 /* No such file or directory */ | |
9 | +#define TARGET_ESRCH 3 /* No such process */ | |
10 | +#define TARGET_EINTR 4 /* Interrupted system call */ | |
11 | +#define TARGET_EIO 5 /* I/O error */ | |
12 | +#define TARGET_ENXIO 6 /* No such device or address */ | |
13 | +#define TARGET_E2BIG 7 /* Argument list too long */ | |
14 | +#define TARGET_ENOEXEC 8 /* TARGET_Exec format error */ | |
15 | +#define TARGET_EBADF 9 /* Bad file number */ | |
16 | +#define TARGET_ECHILD 10 /* No child processes */ | |
17 | +#define TARGET_EAGAIN 11 /* Try again */ | |
18 | +#define TARGET_ENOMEM 12 /* Out of memory */ | |
19 | +#define TARGET_EACCES 13 /* Permission denied */ | |
20 | +#define TARGET_EFAULT 14 /* Bad address */ | |
21 | +#define TARGET_ENOTBLK 15 /* Block device required */ | |
22 | +#define TARGET_EBUSY 16 /* Device or resource busy */ | |
23 | +#define TARGET_EEXIST 17 /* File exists */ | |
24 | +#define TARGET_EXDEV 18 /* Cross-device link */ | |
25 | +#define TARGET_ENODEV 19 /* No such device */ | |
26 | +#define TARGET_ENOTDIR 20 /* Not a directory */ | |
27 | +#define TARGET_EISDIR 21 /* Is a directory */ | |
28 | +#define TARGET_EINVAL 22 /* Invalid argument */ | |
29 | +#define TARGET_ENFILE 23 /* File table overflow */ | |
30 | +#define TARGET_EMFILE 24 /* Too many open files */ | |
31 | +#define TARGET_ENOTTY 25 /* Not a typewriter */ | |
32 | +#define TARGET_ETXTBSY 26 /* Text file busy */ | |
33 | +#define TARGET_EFBIG 27 /* File too large */ | |
34 | +#define TARGET_ENOSPC 28 /* No space left on device */ | |
35 | +#define TARGET_ESPIPE 29 /* Illegal seek */ | |
36 | +#define TARGET_EROFS 30 /* Read-only file system */ | |
37 | +#define TARGET_EMLINK 31 /* Too many links */ | |
38 | +#define TARGET_EPIPE 32 /* Broken pipe */ | |
39 | +#define TARGET_EDOM 33 /* Math argument out of domain of func */ | |
40 | +#define TARGET_ERANGE 34 /* Math result not representable */ | |
41 | + | |
42 | +#define TARGET_EDEADLK 35 /* Resource deadlock would occur */ | |
43 | +#define TARGET_ENAMETOOLONG 36 /* File name too long */ | |
44 | +#define TARGET_ENOLCK 37 /* No record locks available */ | |
45 | +#define TARGET_ENOSYS 38 /* Function not implemented */ | |
46 | +#define TARGET_ENOTEMPTY 39 /* Directory not empty */ | |
47 | +#define TARGET_ELOOP 40 /* Too many symbolic links encountered */ | |
48 | + | |
49 | +#define TARGET_ENOMSG 42 /* No message of desired type */ | |
50 | +#define TARGET_EIDRM 43 /* Identifier removed */ | |
51 | +#define TARGET_ECHRNG 44 /* Channel number out of range */ | |
52 | +#define TARGET_EL2NSYNC 45 /* Level 2 not synchronized */ | |
53 | +#define TARGET_EL3HLT 46 /* Level 3 halted */ | |
54 | +#define TARGET_EL3RST 47 /* Level 3 reset */ | |
55 | +#define TARGET_ELNRNG 48 /* Link number out of range */ | |
56 | +#define TARGET_EUNATCH 49 /* Protocol driver not attached */ | |
57 | +#define TARGET_ENOCSI 50 /* No CSI structure available */ | |
58 | +#define TARGET_EL2HLT 51 /* Level 2 halted */ | |
59 | +#define TARGET_EBADE 52 /* Invalid exchange */ | |
60 | +#define TARGET_EBADR 53 /* Invalid request descriptor */ | |
61 | +#define TARGET_EXFULL 54 /* TARGET_Exchange full */ | |
62 | +#define TARGET_ENOANO 55 /* No anode */ | |
63 | +#define TARGET_EBADRQC 56 /* Invalid request code */ | |
64 | +#define TARGET_EBADSLT 57 /* Invalid slot */ | |
65 | + | |
66 | +#define TARGET_EBFONT 59 /* Bad font file format */ | |
67 | +#define TARGET_ENOSTR 60 /* Device not a stream */ | |
68 | +#define TARGET_ENODATA 61 /* No data available */ | |
69 | +#define TARGET_ETIME 62 /* Timer expired */ | |
70 | +#define TARGET_ENOSR 63 /* Out of streams resources */ | |
71 | +#define TARGET_ENONET 64 /* Machine is not on the network */ | |
72 | +#define TARGET_ENOPKG 65 /* Package not installed */ | |
73 | +#define TARGET_EREMOTE 66 /* Object is remote */ | |
74 | +#define TARGET_ENOLINK 67 /* Link has been severed */ | |
75 | +#define TARGET_EADV 68 /* Advertise error */ | |
76 | +#define TARGET_ESRMNT 69 /* Srmount error */ | |
77 | +#define TARGET_ECOMM 70 /* Communication error on send */ | |
78 | +#define TARGET_EPROTO 71 /* Protocol error */ | |
79 | +#define TARGET_EMULTIHOP 72 /* Multihop attempted */ | |
80 | +#define TARGET_EDOTDOT 73 /* RFS specific error */ | |
81 | +#define TARGET_EBADMSG 74 /* Not a data message */ | |
82 | +#define TARGET_EOVERFLOW 75 /* Value too large for defined data type */ | |
83 | +#define TARGET_ENOTUNIQ 76 /* Name not unique on network */ | |
84 | +#define TARGET_EBADFD 77 /* File descriptor in bad state */ | |
85 | +#define TARGET_EREMCHG 78 /* Remote address changed */ | |
86 | +#define TARGET_ELIBACC 79 /* Can not access a needed shared library */ | |
87 | +#define TARGET_ELIBBAD 80 /* Accessing a corrupted shared library */ | |
88 | +#define TARGET_ELIBSCN 81 /* .lib section in a.out corrupted */ | |
89 | +#define TARGET_ELIBMAX 82 /* Attempting to link in too many shared libraries */ | |
90 | +#define TARGET_ELIBEXEC 83 /* Cannot exec a shared library directly */ | |
91 | +#define TARGET_EILSEQ 84 /* Illegal byte sequence */ | |
92 | +#define TARGET_ERESTART 85 /* Interrupted system call should be restarted */ | |
93 | +#define TARGET_ESTRPIPE 86 /* Streams pipe error */ | |
94 | +#define TARGET_EUSERS 87 /* Too many users */ | |
95 | +#define TARGET_ENOTSOCK 88 /* Socket operation on non-socket */ | |
96 | +#define TARGET_EDESTADDRREQ 89 /* Destination address required */ | |
97 | +#define TARGET_EMSGSIZE 90 /* Message too long */ | |
98 | +#define TARGET_EPROTOTYPE 91 /* Protocol wrong type for socket */ | |
99 | +#define TARGET_ENOPROTOOPT 92 /* Protocol not available */ | |
100 | +#define TARGET_EPROTONOSUPPORT 93 /* Protocol not supported */ | |
101 | +#define TARGET_ESOCKTNOSUPPORT 94 /* Socket type not supported */ | |
102 | +#define TARGET_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ | |
103 | +#define TARGET_EPFNOSUPPORT 96 /* Protocol family not supported */ | |
104 | +#define TARGET_EAFNOSUPPORT 97 /* Address family not supported by protocol */ | |
105 | +#define TARGET_EADDRINUSE 98 /* Address already in use */ | |
106 | +#define TARGET_EADDRNOTAVAIL 99 /* Cannot assign requested address */ | |
107 | +#define TARGET_ENETDOWN 100 /* Network is down */ | |
108 | +#define TARGET_ENETUNREACH 101 /* Network is unreachable */ | |
109 | +#define TARGET_ENETRESET 102 /* Network dropped connection because of reset */ | |
110 | +#define TARGET_ECONNABORTED 103 /* Software caused connection abort */ | |
111 | +#define TARGET_ECONNRESET 104 /* Connection reset by peer */ | |
112 | +#define TARGET_ENOBUFS 105 /* No buffer space available */ | |
113 | +#define TARGET_EISCONN 106 /* Transport endpoint is already connected */ | |
114 | +#define TARGET_ENOTCONN 107 /* Transport endpoint is not connected */ | |
115 | +#define TARGET_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ | |
116 | +#define TARGET_ETOOMANYREFS 109 /* Too many references: cannot splice */ | |
117 | +#define TARGET_ETIMEDOUT 110 /* Connection timed out */ | |
118 | +#define TARGET_ECONNREFUSED 111 /* Connection refused */ | |
119 | +#define TARGET_EHOSTDOWN 112 /* Host is down */ | |
120 | +#define TARGET_EHOSTUNREACH 113 /* No route to host */ | |
121 | +#define TARGET_EALREADY 114 /* Operation already in progress */ | |
122 | +#define TARGET_EINPROGRESS 115 /* Operation now in progress */ | |
123 | +#define TARGET_ESTALE 116 /* Stale NFS file handle */ | |
124 | +#define TARGET_EUCLEAN 117 /* Structure needs cleaning */ | |
125 | +#define TARGET_ENOTNAM 118 /* Not a XENIX named type file */ | |
126 | +#define TARGET_ENAVAIL 119 /* No XENIX semaphores available */ | |
127 | +#define TARGET_EISNAM 120 /* Is a named type file */ | |
128 | +#define TARGET_EREMOTEIO 121 /* Remote I/O error */ | |
129 | +#define TARGET_EDQUOT 122 /* Quota exceeded */ | |
130 | + | |
131 | +#define TARGET_ENOMEDIUM 123 /* No medium found */ | |
132 | +#define TARGET_EMEDIUMTYPE 124 /* Wrong medium type */ | |
133 | +#define TARGET_ECANCELED 125 /* Operation Canceled */ | |
134 | +#define TARGET_ENOKEY 126 /* Required key not available */ | |
135 | +#define TARGET_EKEYEXPIRED 127 /* Key has expired */ | |
136 | +#define TARGET_EKEYREVOKED 128 /* Key has been revoked */ | |
137 | +#define TARGET_EKEYREJECTED 129 /* Key was rejected by service */ | |
138 | + | |
139 | +/* for robust mutexes */ | |
140 | +#define TARGET_EOWNERDEAD 130 /* Owner died */ | |
141 | +#define TARGET_ENOTRECOVERABLE 131 /* State not recoverable */ | |
142 | + | ... | ... |
linux-user/mips/syscall.h
... | ... | @@ -20,4 +20,207 @@ struct target_pt_regs { |
20 | 20 | target_ulong cp0_epc; |
21 | 21 | }; |
22 | 22 | |
23 | +/* Target errno definitions taken from asm-mips/errno.h */ | |
24 | +#undef TARGET_ENOMSG | |
25 | +#define TARGET_ENOMSG 35 /* Identifier removed */ | |
26 | +#undef TARGET_EIDRM | |
27 | +#define TARGET_EIDRM 36 /* Identifier removed */ | |
28 | +#undef TARGET_ECHRNG | |
29 | +#define TARGET_ECHRNG 37 /* Channel number out of range */ | |
30 | +#undef TARGET_EL2NSYNC | |
31 | +#define TARGET_EL2NSYNC 38 /* Level 2 not synchronized */ | |
32 | +#undef TARGET_EL3HLT | |
33 | +#define TARGET_EL3HLT 39 /* Level 3 halted */ | |
34 | +#undef TARGET_EL3RST | |
35 | +#define TARGET_EL3RST 40 /* Level 3 reset */ | |
36 | +#undef TARGET_ELNRNG | |
37 | +#define TARGET_ELNRNG 41 /* Link number out of range */ | |
38 | +#undef TARGET_EUNATCH | |
39 | +#define TARGET_EUNATCH 42 /* Protocol driver not attached */ | |
40 | +#undef TARGET_ENOCSI | |
41 | +#define TARGET_ENOCSI 43 /* No CSI structure available */ | |
42 | +#undef TARGET_EL2HLT | |
43 | +#define TARGET_EL2HLT 44 /* Level 2 halted */ | |
44 | +#undef TARGET_EDEADLK | |
45 | +#define TARGET_EDEADLK 45 /* Resource deadlock would occur */ | |
46 | +#undef TARGET_ENOLCK | |
47 | +#define TARGET_ENOLCK 46 /* No record locks available */ | |
48 | +#undef TARGET_EBADE | |
49 | +#define TARGET_EBADE 50 /* Invalid exchange */ | |
50 | +#undef TARGET_EBADR | |
51 | +#define TARGET_EBADR 51 /* Invalid request descriptor */ | |
52 | +#undef TARGET_EXFULL | |
53 | +#define TARGET_EXFULL 52 /* TARGET_Exchange full */ | |
54 | +#undef TARGET_ENOANO | |
55 | +#define TARGET_ENOANO 53 /* No anode */ | |
56 | +#undef TARGET_EBADRQC | |
57 | +#define TARGET_EBADRQC 54 /* Invalid request code */ | |
58 | +#undef TARGET_EBADSLT | |
59 | +#define TARGET_EBADSLT 55 /* Invalid slot */ | |
60 | +#undef TARGET_EDEADLOCK | |
61 | +#define TARGET_EDEADLOCK 56 /* File locking deadlock error */ | |
62 | +#undef TARGET_EBFONT | |
63 | +#define TARGET_EBFONT 59 /* Bad font file format */ | |
64 | +#undef TARGET_ENOSTR | |
65 | +#define TARGET_ENOSTR 60 /* Device not a stream */ | |
66 | +#undef TARGET_ENODATA | |
67 | +#define TARGET_ENODATA 61 /* No data available */ | |
68 | +#undef TARGET_ETIME | |
69 | +#define TARGET_ETIME 62 /* Timer expired */ | |
70 | +#undef TARGET_ENOSR | |
71 | +#define TARGET_ENOSR 63 /* Out of streams resources */ | |
72 | +#undef TARGET_ENONET | |
73 | +#define TARGET_ENONET 64 /* Machine is not on the network */ | |
74 | +#undef TARGET_ENOPKG | |
75 | +#define TARGET_ENOPKG 65 /* Package not installed */ | |
76 | +#undef TARGET_EREMOTE | |
77 | +#define TARGET_EREMOTE 66 /* Object is remote */ | |
78 | +#undef TARGET_ENOLINK | |
79 | +#define TARGET_ENOLINK 67 /* Link has been severed */ | |
80 | +#undef TARGET_EADV | |
81 | +#define TARGET_EADV 68 /* Advertise error */ | |
82 | +#undef TARGET_ESRMNT | |
83 | +#define TARGET_ESRMNT 69 /* Srmount error */ | |
84 | +#undef TARGET_ECOMM | |
85 | +#define TARGET_ECOMM 70 /* Communication error on send */ | |
86 | +#undef TARGET_EPROTO | |
87 | +#define TARGET_EPROTO 71 /* Protocol error */ | |
88 | +#undef TARGET_EDOTDOT | |
89 | +#define TARGET_EDOTDOT 73 /* RFS specific error */ | |
90 | +#undef TARGET_EMULTIHOP | |
91 | +#define TARGET_EMULTIHOP 74 /* Multihop attempted */ | |
92 | +#undef TARGET_EBADMSG | |
93 | +#define TARGET_EBADMSG 77 /* Not a data message */ | |
94 | +#undef TARGET_ENAMETOOLONG | |
95 | +#define TARGET_ENAMETOOLONG 78 /* File name too long */ | |
96 | +#undef TARGET_EOVERFLOW | |
97 | +#define TARGET_EOVERFLOW 79 /* Value too large for defined data type */ | |
98 | +#undef TARGET_ENOTUNIQ | |
99 | +#define TARGET_ENOTUNIQ 80 /* Name not unique on network */ | |
100 | +#undef TARGET_EBADFD | |
101 | +#define TARGET_EBADFD 81 /* File descriptor in bad state */ | |
102 | +#undef TARGET_EREMCHG | |
103 | +#define TARGET_EREMCHG 82 /* Remote address changed */ | |
104 | +#undef TARGET_ELIBACC | |
105 | +#define TARGET_ELIBACC 83 /* Can not access a needed shared library */ | |
106 | +#undef TARGET_ELIBBAD | |
107 | +#define TARGET_ELIBBAD 84 /* Accessing a corrupted shared library */ | |
108 | +#undef TARGET_ELIBSCN | |
109 | +#define TARGET_ELIBSCN 85 /* .lib section in a.out corrupted */ | |
110 | +#undef TARGET_ELIBMAX | |
111 | +#define TARGET_ELIBMAX 86 /* Attempting to link in too many shared libraries */ | |
112 | +#undef TARGET_ELIBEXEC | |
113 | +#define TARGET_ELIBEXEC 87 /* Cannot exec a shared library directly */ | |
114 | +#undef TARGET_EILSEQ | |
115 | +#define TARGET_EILSEQ 88 /* Illegal byte sequence */ | |
116 | +#undef TARGET_ENOSYS | |
117 | +#define TARGET_ENOSYS 89 /* Function not implemented */ | |
118 | +#undef TARGET_ELOOP | |
119 | +#define TARGET_ELOOP 90 /* Too many symbolic links encountered */ | |
120 | +#undef TARGET_ERESTART | |
121 | +#define TARGET_ERESTART 91 /* Interrupted system call should be restarted */ | |
122 | +#undef TARGET_ESTRPIPE | |
123 | +#define TARGET_ESTRPIPE 92 /* Streams pipe error */ | |
124 | +#undef TARGET_ENOTEMPTY | |
125 | +#define TARGET_ENOTEMPTY 93 /* Directory not empty */ | |
126 | +#undef TARGET_EUSERS | |
127 | +#define TARGET_EUSERS 94 /* Too many users */ | |
128 | +#undef TARGET_ENOTSOCK | |
129 | +#define TARGET_ENOTSOCK 95 /* Socket operation on non-socket */ | |
130 | +#undef TARGET_EDESTADDRREQ | |
131 | +#define TARGET_EDESTADDRREQ 96 /* Destination address required */ | |
132 | +#undef TARGET_EMSGSIZE | |
133 | +#define TARGET_EMSGSIZE 97 /* Message too long */ | |
134 | +#undef TARGET_EPROTOTYPE | |
135 | +#define TARGET_EPROTOTYPE 98 /* Protocol wrong type for socket */ | |
136 | +#undef TARGET_ENOPROTOOPT | |
137 | +#define TARGET_ENOPROTOOPT 99 /* Protocol not available */ | |
138 | +#undef TARGET_EPROTONOSUPPORT | |
139 | +#define TARGET_EPROTONOSUPPORT 120 /* Protocol not supported */ | |
140 | +#undef TARGET_ESOCKTNOSUPPORT | |
141 | +#define TARGET_ESOCKTNOSUPPORT 121 /* Socket type not supported */ | |
142 | +#undef TARGET_EOPNOTSUPP | |
143 | +#define TARGET_EOPNOTSUPP 122 /* Operation not supported on transport endpoint */ | |
144 | +#undef TARGET_EPFNOSUPPORT | |
145 | +#define TARGET_EPFNOSUPPORT 123 /* Protocol family not supported */ | |
146 | +#undef TARGET_EAFNOSUPPORT | |
147 | +#define TARGET_EAFNOSUPPORT 124 /* Address family not supported by protocol */ | |
148 | +#undef TARGET_EADDRINUSE | |
149 | +#define TARGET_EADDRINUSE 125 /* Address already in use */ | |
150 | +#undef TARGET_EADDRNOTAVAIL | |
151 | +#define TARGET_EADDRNOTAVAIL 126 /* Cannot assign requested address */ | |
152 | +#undef TARGET_ENETDOWN | |
153 | +#define TARGET_ENETDOWN 127 /* Network is down */ | |
154 | +#undef TARGET_ENETUNREACH | |
155 | +#define TARGET_ENETUNREACH 128 /* Network is unreachable */ | |
156 | +#undef TARGET_ENETRESET | |
157 | +#define TARGET_ENETRESET 129 /* Network dropped connection because of reset */ | |
158 | +#undef TARGET_ECONNABORTED | |
159 | +#define TARGET_ECONNABORTED 130 /* Software caused connection abort */ | |
160 | +#undef TARGET_ECONNRESET | |
161 | +#define TARGET_ECONNRESET 131 /* Connection reset by peer */ | |
162 | +#undef TARGET_ENOBUFS | |
163 | +#define TARGET_ENOBUFS 132 /* No buffer space available */ | |
164 | +#undef TARGET_EISCONN | |
165 | +#define TARGET_EISCONN 133 /* Transport endpoint is already connected */ | |
166 | +#undef TARGET_ENOTCONN | |
167 | +#define TARGET_ENOTCONN 134 /* Transport endpoint is not connected */ | |
168 | +#undef TARGET_EUCLEAN | |
169 | +#define TARGET_EUCLEAN 135 /* Structure needs cleaning */ | |
170 | +#undef TARGET_ENOTNAM | |
171 | +#define TARGET_ENOTNAM 137 /* Not a XENIX named type file */ | |
172 | +#undef TARGET_ENAVAIL | |
173 | +#define TARGET_ENAVAIL 138 /* No XENIX semaphores available */ | |
174 | +#undef TARGET_EISNAM | |
175 | +#define TARGET_EISNAM 139 /* Is a named type file */ | |
176 | +#undef TARGET_EREMOTEIO | |
177 | +#define TARGET_EREMOTEIO 140 /* Remote I/O error */ | |
178 | +#undef TARGET_EINIT | |
179 | +#define TARGET_EINIT 141 /* Reserved */ | |
180 | +#undef TARGET_EREMDEV | |
181 | +#define TARGET_EREMDEV 142 /* TARGET_Error 142 */ | |
182 | +#undef TARGET_ESHUTDOWN | |
183 | +#define TARGET_ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */ | |
184 | +#undef TARGET_ETOOMANYREFS | |
185 | +#define TARGET_ETOOMANYREFS 144 /* Too many references: cannot splice */ | |
186 | +#undef TARGET_ETIMEDOUT | |
187 | +#define TARGET_ETIMEDOUT 145 /* Connection timed out */ | |
188 | +#undef TARGET_ECONNREFUSED | |
189 | +#define TARGET_ECONNREFUSED 146 /* Connection refused */ | |
190 | +#undef TARGET_EHOSTDOWN | |
191 | +#define TARGET_EHOSTDOWN 147 /* Host is down */ | |
192 | +#undef TARGET_EHOSTUNREACH | |
193 | +#define TARGET_EHOSTUNREACH 148 /* No route to host */ | |
194 | +#undef TARGET_EALREADY | |
195 | +#define TARGET_EALREADY 149 /* Operation already in progress */ | |
196 | +#undef TARGET_EINPROGRESS | |
197 | +#define TARGET_EINPROGRESS 150 /* Operation now in progress */ | |
198 | +#undef TARGET_ESTALE | |
199 | +#define TARGET_ESTALE 151 /* Stale NFS file handle */ | |
200 | +#undef TARGET_ECANCELED | |
201 | +#define TARGET_ECANCELED 158 /* AIO operation canceled */ | |
202 | +/* | |
203 | + * These error are Linux extensions. | |
204 | + */ | |
205 | +#undef TARGET_ENOMEDIUM | |
206 | +#define TARGET_ENOMEDIUM 159 /* No medium found */ | |
207 | +#undef TARGET_EMEDIUMTYPE | |
208 | +#define TARGET_EMEDIUMTYPE 160 /* Wrong medium type */ | |
209 | +#undef TARGET_ENOKEY | |
210 | +#define TARGET_ENOKEY 161 /* Required key not available */ | |
211 | +#undef TARGET_EKEYEXPIRED | |
212 | +#define TARGET_EKEYEXPIRED 162 /* Key has expired */ | |
213 | +#undef TARGET_EKEYREVOKED | |
214 | +#define TARGET_EKEYREVOKED 163 /* Key has been revoked */ | |
215 | +#undef TARGET_EKEYREJECTED | |
216 | +#define TARGET_EKEYREJECTED 164 /* Key was rejected by service */ | |
217 | + | |
218 | +/* for robust mutexes */ | |
219 | +#undef TARGET_EOWNERDEAD | |
220 | +#define TARGET_EOWNERDEAD 165 /* Owner died */ | |
221 | +#undef TARGET_ENOTRECOVERABLE | |
222 | +#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */ | |
223 | + | |
224 | + | |
225 | + | |
23 | 226 | #define UNAME_MACHINE "mips" | ... | ... |
linux-user/syscall.c
... | ... | @@ -181,10 +181,117 @@ extern int setresgid(gid_t, gid_t, gid_t); |
181 | 181 | extern int getresgid(gid_t *, gid_t *, gid_t *); |
182 | 182 | extern int setgroups(int, gid_t *); |
183 | 183 | |
184 | +/* | |
185 | + * This list is the union of errno values overidden in asm-<arch>/errno.h | |
186 | + * minus the errnos that are not actually generic to all archs. | |
187 | + */ | |
188 | +static uint16_t host_to_target_errno_table[1200] = { | |
189 | + [EIDRM] = TARGET_EIDRM, | |
190 | + [ECHRNG] = TARGET_ECHRNG, | |
191 | + [EL2NSYNC] = TARGET_EL2NSYNC, | |
192 | + [EL3HLT] = TARGET_EL3HLT, | |
193 | + [EL3RST] = TARGET_EL3RST, | |
194 | + [ELNRNG] = TARGET_ELNRNG, | |
195 | + [EUNATCH] = TARGET_EUNATCH, | |
196 | + [ENOCSI] = TARGET_ENOCSI, | |
197 | + [EL2HLT] = TARGET_EL2HLT, | |
198 | + [EDEADLK] = TARGET_EDEADLK, | |
199 | + [ENOLCK] = TARGET_ENOLCK, | |
200 | + [EBADE] = TARGET_EBADE, | |
201 | + [EBADR] = TARGET_EBADR, | |
202 | + [EXFULL] = TARGET_EXFULL, | |
203 | + [ENOANO] = TARGET_ENOANO, | |
204 | + [EBADRQC] = TARGET_EBADRQC, | |
205 | + [EBADSLT] = TARGET_EBADSLT, | |
206 | + [EBFONT] = TARGET_EBFONT, | |
207 | + [ENOSTR] = TARGET_ENOSTR, | |
208 | + [ENODATA] = TARGET_ENODATA, | |
209 | + [ETIME] = TARGET_ETIME, | |
210 | + [ENOSR] = TARGET_ENOSR, | |
211 | + [ENONET] = TARGET_ENONET, | |
212 | + [ENOPKG] = TARGET_ENOPKG, | |
213 | + [EREMOTE] = TARGET_EREMOTE, | |
214 | + [ENOLINK] = TARGET_ENOLINK, | |
215 | + [EADV] = TARGET_EADV, | |
216 | + [ESRMNT] = TARGET_ESRMNT, | |
217 | + [ECOMM] = TARGET_ECOMM, | |
218 | + [EPROTO] = TARGET_EPROTO, | |
219 | + [EDOTDOT] = TARGET_EDOTDOT, | |
220 | + [EMULTIHOP] = TARGET_EMULTIHOP, | |
221 | + [EBADMSG] = TARGET_EBADMSG, | |
222 | + [ENAMETOOLONG] = TARGET_ENAMETOOLONG, | |
223 | + [EOVERFLOW] = TARGET_EOVERFLOW, | |
224 | + [ENOTUNIQ] = TARGET_ENOTUNIQ, | |
225 | + [EBADFD] = TARGET_EBADFD, | |
226 | + [EREMCHG] = TARGET_EREMCHG, | |
227 | + [ELIBACC] = TARGET_ELIBACC, | |
228 | + [ELIBBAD] = TARGET_ELIBBAD, | |
229 | + [ELIBSCN] = TARGET_ELIBSCN, | |
230 | + [ELIBMAX] = TARGET_ELIBMAX, | |
231 | + [ELIBEXEC] = TARGET_ELIBEXEC, | |
232 | + [EILSEQ] = TARGET_EILSEQ, | |
233 | + [ENOSYS] = TARGET_ENOSYS, | |
234 | + [ELOOP] = TARGET_ELOOP, | |
235 | + [ERESTART] = TARGET_ERESTART, | |
236 | + [ESTRPIPE] = TARGET_ESTRPIPE, | |
237 | + [ENOTEMPTY] = TARGET_ENOTEMPTY, | |
238 | + [EUSERS] = TARGET_EUSERS, | |
239 | + [ENOTSOCK] = TARGET_ENOTSOCK, | |
240 | + [EDESTADDRREQ] = TARGET_EDESTADDRREQ, | |
241 | + [EMSGSIZE] = TARGET_EMSGSIZE, | |
242 | + [EPROTOTYPE] = TARGET_EPROTOTYPE, | |
243 | + [ENOPROTOOPT] = TARGET_ENOPROTOOPT, | |
244 | + [EPROTONOSUPPORT] = TARGET_EPROTONOSUPPORT, | |
245 | + [ESOCKTNOSUPPORT] = TARGET_ESOCKTNOSUPPORT, | |
246 | + [EOPNOTSUPP] = TARGET_EOPNOTSUPP, | |
247 | + [EPFNOSUPPORT] = TARGET_EPFNOSUPPORT, | |
248 | + [EAFNOSUPPORT] = TARGET_EAFNOSUPPORT, | |
249 | + [EADDRINUSE] = TARGET_EADDRINUSE, | |
250 | + [EADDRNOTAVAIL] = TARGET_EADDRNOTAVAIL, | |
251 | + [ENETDOWN] = TARGET_ENETDOWN, | |
252 | + [ENETUNREACH] = TARGET_ENETUNREACH, | |
253 | + [ENETRESET] = TARGET_ENETRESET, | |
254 | + [ECONNABORTED] = TARGET_ECONNABORTED, | |
255 | + [ECONNRESET] = TARGET_ECONNRESET, | |
256 | + [ENOBUFS] = TARGET_ENOBUFS, | |
257 | + [EISCONN] = TARGET_EISCONN, | |
258 | + [ENOTCONN] = TARGET_ENOTCONN, | |
259 | + [EUCLEAN] = TARGET_EUCLEAN, | |
260 | + [ENOTNAM] = TARGET_ENOTNAM, | |
261 | + [ENAVAIL] = TARGET_ENAVAIL, | |
262 | + [EISNAM] = TARGET_EISNAM, | |
263 | + [EREMOTEIO] = TARGET_EREMOTEIO, | |
264 | + [ESHUTDOWN] = TARGET_ESHUTDOWN, | |
265 | + [ETOOMANYREFS] = TARGET_ETOOMANYREFS, | |
266 | + [ETIMEDOUT] = TARGET_ETIMEDOUT, | |
267 | + [ECONNREFUSED] = TARGET_ECONNREFUSED, | |
268 | + [EHOSTDOWN] = TARGET_EHOSTDOWN, | |
269 | + [EHOSTUNREACH] = TARGET_EHOSTUNREACH, | |
270 | + [EALREADY] = TARGET_EALREADY, | |
271 | + [EINPROGRESS] = TARGET_EINPROGRESS, | |
272 | + [ESTALE] = TARGET_ESTALE, | |
273 | + [ECANCELED] = TARGET_ECANCELED, | |
274 | + [ENOMEDIUM] = TARGET_ENOMEDIUM, | |
275 | + [EMEDIUMTYPE] = TARGET_EMEDIUMTYPE, | |
276 | + [ENOKEY] = TARGET_ENOKEY, | |
277 | + [EKEYEXPIRED] = TARGET_EKEYEXPIRED, | |
278 | + [EKEYREVOKED] = TARGET_EKEYREVOKED, | |
279 | + [EKEYREJECTED] = TARGET_EKEYREJECTED, | |
280 | + [EOWNERDEAD] = TARGET_EOWNERDEAD, | |
281 | + [ENOTRECOVERABLE] = TARGET_ENOTRECOVERABLE, | |
282 | + }; | |
283 | + | |
284 | +static inline int host_to_target_errno(int err) | |
285 | +{ | |
286 | + if(host_to_target_errno_table[err]) | |
287 | + return host_to_target_errno_table[err]; | |
288 | + return err; | |
289 | +} | |
290 | + | |
184 | 291 | static inline long get_errno(long ret) |
185 | 292 | { |
186 | 293 | if (ret == -1) |
187 | - return -errno; | |
294 | + return -host_to_target_errno(errno); | |
188 | 295 | else |
189 | 296 | return ret; |
190 | 297 | } | ... | ... |