Changeset 96073 in vbox for trunk/src/VBox/Runtime/common/err
- Timestamp:
- Aug 6, 2022 12:20:33 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152872
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/err/nocrt-strerror.cpp
r96039 r96073 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Convert errno to iprt status codes.3 * IPRT - No-CRT - Convert errno value to string. 4 4 */ 5 5 … … 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 # include <iprt/err.h>32 #include "internal/ iprt.h"33 34 #include <iprt/ log.h>31 #define IPRT_NO_CRT_FOR_3RD_PARTY 32 #include "internal/nocrt.h" 33 #include <iprt/nocrt/string.h> 34 #include <iprt/nocrt/errno.h> 35 35 #include <iprt/assert.h> 36 #include <iprt/errno.h> 37 38 39 RTDECL(int) RTErrConvertFromErrno(int iNativeCode)36 37 38 #undef strerror 39 const char *RT_NOCRT(strerror)(int iErrNo) 40 40 { 41 /* very fast check for no error. */42 if (iNativeCode == 0)43 return VINF_SUCCESS;44 45 41 /* 46 42 * Process error codes. … … 50 46 * 51 47 * This switch is arranged like the Linux i386 errno.h! This switch is mirrored 52 * by RTErrConvertToErrno .48 * by RTErrConvertToErrno and RTErrConvertFromErrno. 53 49 */ 54 switch (i NativeCode)50 switch (iErrNo) 55 51 { /* Linux number */ 52 case 0: return "no error"; 56 53 #ifdef EPERM 57 case EPERM: return VERR_ACCESS_DENIED; /* 1 */54 RT_CASE_RET_STR(EPERM); /* 1 */ 58 55 #endif 59 56 #ifdef ENOENT 60 case ENOENT: return VERR_FILE_NOT_FOUND;57 RT_CASE_RET_STR(ENOENT); 61 58 #endif 62 59 #ifdef ESRCH 63 case ESRCH: return VERR_PROCESS_NOT_FOUND;60 RT_CASE_RET_STR(ESRCH); 64 61 #endif 65 62 #ifdef EINTR 66 case EINTR: return VERR_INTERRUPTED;63 RT_CASE_RET_STR(EINTR); 67 64 #endif 68 65 #ifdef EIO 69 case EIO: return VERR_DEV_IO_ERROR;66 RT_CASE_RET_STR(EIO); 70 67 #endif 71 68 #ifdef ENXIO 72 case ENXIO: return VERR_DEV_IO_ERROR; /** @todo fix this duplicate error */69 RT_CASE_RET_STR(ENXIO); /** @todo fix this duplicate error */ 73 70 #endif 74 71 #ifdef E2BIG 75 case E2BIG: return VERR_TOO_MUCH_DATA;72 RT_CASE_RET_STR(E2BIG); 76 73 #endif 77 74 #ifdef ENOEXEC 78 case ENOEXEC: return VERR_BAD_EXE_FORMAT;75 RT_CASE_RET_STR(ENOEXEC); 79 76 #endif 80 77 #ifdef EBADF 81 case EBADF: return VERR_INVALID_HANDLE;78 RT_CASE_RET_STR(EBADF); 82 79 #endif 83 80 #ifdef ECHILD 84 case ECHILD: return VERR_PROCESS_NOT_FOUND; /* 10 */ /** @todo fix duplicate error */81 RT_CASE_RET_STR(ECHILD); /* 10 */ /** @todo fix duplicate error */ 85 82 #endif 86 83 #ifdef EAGAIN 87 case EAGAIN: return VERR_TRY_AGAIN;84 RT_CASE_RET_STR(EAGAIN); 88 85 #endif 89 86 #ifdef ENOMEM 90 case ENOMEM: return VERR_NO_MEMORY;87 RT_CASE_RET_STR(ENOMEM); 91 88 #endif 92 89 #ifdef EACCES 93 case EACCES: return VERR_ACCESS_DENIED; /** @todo fix duplicate error */90 RT_CASE_RET_STR(EACCES); /** @todo fix duplicate error */ 94 91 #endif 95 92 #ifdef EFAULT 96 case EFAULT: return VERR_INVALID_POINTER;93 RT_CASE_RET_STR(EFAULT); 97 94 #endif 98 95 #ifdef ENOTBLK 99 //case ENOTBLK: return VERR_;96 RT_CASE_RET_STR(ENOTBLK); 100 97 #endif 101 98 #ifdef EBUSY 102 case EBUSY: return VERR_RESOURCE_BUSY;99 RT_CASE_RET_STR(EBUSY); 103 100 #endif 104 101 #ifdef EEXIST 105 case EEXIST: return VERR_ALREADY_EXISTS;102 RT_CASE_RET_STR(EEXIST); 106 103 #endif 107 104 #ifdef EXDEV 108 case EXDEV: return VERR_NOT_SAME_DEVICE;105 RT_CASE_RET_STR(EXDEV); 109 106 #endif 110 107 #ifdef ENODEV 111 case ENODEV: return VERR_NOT_SUPPORTED; /** @todo fix duplicate error */108 RT_CASE_RET_STR(ENODEV); /** @todo fix duplicate error */ 112 109 #endif 113 110 #ifdef ENOTDIR 114 case ENOTDIR: return VERR_PATH_NOT_FOUND; /* 20 */111 RT_CASE_RET_STR(ENOTDIR); /* 20 */ 115 112 #endif 116 113 #ifdef EISDIR 117 case EISDIR: return VERR_IS_A_DIRECTORY;114 RT_CASE_RET_STR(EISDIR); 118 115 #endif 119 116 #ifdef EINVAL 120 case EINVAL: return VERR_INVALID_PARAMETER;117 RT_CASE_RET_STR(EINVAL); 121 118 #endif 122 119 #ifdef ENFILE 123 case ENFILE: return VERR_TOO_MANY_OPEN_FILES; /** @todo fix duplicate error */120 RT_CASE_RET_STR(ENFILE); /** @todo fix duplicate error */ 124 121 #endif 125 122 #ifdef EMFILE 126 case EMFILE: return VERR_TOO_MANY_OPEN_FILES;123 RT_CASE_RET_STR(EMFILE); 127 124 #endif 128 125 #ifdef ENOTTY 129 case ENOTTY: return VERR_INVALID_FUNCTION;126 RT_CASE_RET_STR(ENOTTY); 130 127 #endif 131 128 #ifdef ETXTBSY 132 case ETXTBSY: return VERR_SHARING_VIOLATION;129 RT_CASE_RET_STR(ETXTBSY); 133 130 #endif 134 131 #ifdef EFBIG 135 case EFBIG: return VERR_FILE_TOO_BIG;132 RT_CASE_RET_STR(EFBIG); 136 133 #endif 137 134 #ifdef ENOSPC 138 case ENOSPC: return VERR_DISK_FULL;135 RT_CASE_RET_STR(ENOSPC); 139 136 #endif 140 137 #ifdef ESPIPE 141 case ESPIPE: return VERR_SEEK_ON_DEVICE;138 RT_CASE_RET_STR(ESPIPE); 142 139 #endif 143 140 #ifdef EROFS 144 case EROFS: return VERR_WRITE_PROTECT; /* 30 */141 RT_CASE_RET_STR(EROFS); /* 30 */ 145 142 #endif 146 143 #ifdef EMLINK 147 //case EMLINK:144 RT_CASE_RET_STR(EMLINK); 148 145 #endif 149 146 #ifdef EPIPE 150 case EPIPE: return VERR_BROKEN_PIPE;147 RT_CASE_RET_STR(EPIPE); 151 148 #endif 152 149 #ifdef EDOM 153 case EDOM: return VERR_INVALID_PARAMETER; /** @todo fix duplicate error */150 RT_CASE_RET_STR(EDOM); /** @todo fix duplicate error */ 154 151 #endif 155 152 #ifdef ERANGE 156 case ERANGE: return VERR_INVALID_PARAMETER; /** @todo fix duplicate error */153 RT_CASE_RET_STR(ERANGE); /** @todo fix duplicate error */ 157 154 #endif 158 155 #ifdef EDEADLK 159 case EDEADLK: return VERR_DEADLOCK;156 RT_CASE_RET_STR(EDEADLK); 160 157 #endif 161 158 #ifdef ENAMETOOLONG 162 case ENAMETOOLONG: return VERR_FILENAME_TOO_LONG;159 RT_CASE_RET_STR(ENAMETOOLONG); 163 160 #endif 164 161 #ifdef ENOLCK 165 case ENOLCK: return VERR_FILE_LOCK_FAILED;162 RT_CASE_RET_STR(ENOLCK); 166 163 #endif 167 164 #ifdef ENOSYS /** @todo map this differently on solaris. */ 168 case ENOSYS: return VERR_NOT_SUPPORTED;165 RT_CASE_RET_STR(ENOSYS); 169 166 #endif 170 167 #ifdef ENOTEMPTY 171 case ENOTEMPTY: return VERR_DIR_NOT_EMPTY;168 RT_CASE_RET_STR(ENOTEMPTY); 172 169 #endif 173 170 #ifdef ELOOP 174 case ELOOP: return VERR_TOO_MANY_SYMLINKS; /* 40 */171 RT_CASE_RET_STR(ELOOP); /* 40 */ 175 172 #endif 176 173 //41?? 177 174 #ifdef ENOMSG 178 //case ENOMSG 42 /* No message of desired type */175 RT_CASE_RET_STR(ENOMSG); 179 176 #endif 180 177 #ifdef EIDRM 181 //case EIDRM 43 /* Identifier removed */178 RT_CASE_RET_STR(EIDRM); 182 179 #endif 183 180 #ifdef ECHRNG 184 //case ECHRNG 44 /* Channel number out of range */181 RT_CASE_RET_STR(ECHRNG); 185 182 #endif 186 183 #ifdef EL2NSYNC 187 //case EL2NSYNC 45 /* Level 2 not synchronized */184 RT_CASE_RET_STR(EL2NSYNC); 188 185 #endif 189 186 #ifdef EL3HLT 190 //case EL3HLT 46 /* Level 3 halted */187 RT_CASE_RET_STR(EL3HLT); 191 188 #endif 192 189 #ifdef EL3RST 193 //case EL3RST 47 /* Level 3 reset */190 RT_CASE_RET_STR(EL3RST); 194 191 #endif 195 192 #ifdef ELNRNG 196 //case ELNRNG 48 /* Link number out of range */193 RT_CASE_RET_STR(ELNRNG); 197 194 #endif 198 195 #ifdef EUNATCH 199 //case EUNATCH 49 /* Protocol driver not attached */196 RT_CASE_RET_STR(EUNATCH); 200 197 #endif 201 198 #ifdef ENOCSI 202 //case ENOCSI 50 /* No CSI structure available */199 RT_CASE_RET_STR(ENOCSI); 203 200 #endif 204 201 #ifdef EL2HLT 205 //case EL2HLT 51 /* Level 2 halted */202 RT_CASE_RET_STR(EL2HLT); 206 203 #endif 207 204 #ifdef EBADE 208 //case EBADE 52 /* Invalid exchange */205 RT_CASE_RET_STR(EBADE); 209 206 #endif 210 207 #ifdef EBADR 211 //case EBADR 53 /* Invalid request descriptor */208 RT_CASE_RET_STR(EBADR); 212 209 #endif 213 210 #ifdef EXFULL 214 //case EXFULL 54 /* Exchange full */211 RT_CASE_RET_STR(EXFULL); 215 212 #endif 216 213 #ifdef ENOANO 217 //case ENOANO 55 /* No anode */214 RT_CASE_RET_STR(ENOANO); 218 215 #endif 219 216 #ifdef EBADRQC 220 //case EBADRQC 56 /* Invalid request code */217 RT_CASE_RET_STR(EBADRQC); 221 218 #endif 222 219 #ifdef EBADSLT 223 //case EBADSLT 57 /* Invalid slot */220 RT_CASE_RET_STR(EBADSLT); 224 221 #endif 225 222 //case 58: 226 223 #ifdef EBFONT 227 //case EBFONT 59 /* Bad font file format */224 RT_CASE_RET_STR(EBFONT); 228 225 #endif 229 226 #ifdef ENOSTR 230 //case ENOSTR 60 /* Device not a stream */227 RT_CASE_RET_STR(ENOSTR); 231 228 #endif 232 229 #ifdef ENODATA 233 case ENODATA: return VERR_NO_DATA;230 RT_CASE_RET_STR(ENODATA); 234 231 #endif 235 232 #ifdef ETIME 236 //case ETIME 62 /* Timer expired */233 RT_CASE_RET_STR(ETIME); 237 234 #endif 238 235 #ifdef ENOSR 239 //case ENOSR 63 /* Out of streams resources */236 RT_CASE_RET_STR(ENOSR); 240 237 #endif 241 238 #ifdef ENONET 242 case ENONET: return VERR_NET_NO_NETWORK;239 RT_CASE_RET_STR(ENONET); 243 240 #endif 244 241 #ifdef ENOPKG 245 //case ENOPKG 65 /* Package not installed */242 RT_CASE_RET_STR(ENOPKG); 246 243 #endif 247 244 #ifdef EREMOTE 248 //case EREMOTE 66 /* Object is remote */245 RT_CASE_RET_STR(EREMOTE); 249 246 #endif 250 247 #ifdef ENOLINK 251 //case ENOLINK 67 /* Link has been severed */248 RT_CASE_RET_STR(ENOLINK); 252 249 #endif 253 250 #ifdef EADV 254 //case EADV 68 /* Advertise error */251 RT_CASE_RET_STR(EADV); 255 252 #endif 256 253 #ifdef ESRMNT 257 //case ESRMNT 69 /* Srmount error */254 RT_CASE_RET_STR(ESRMNT); 258 255 #endif 259 256 #ifdef ECOMM 260 //case ECOMM 70 /* Communication error on send */257 RT_CASE_RET_STR(ECOMM); 261 258 #endif 262 259 #ifdef EPROTO 263 case EPROTO: return VERR_NET_PROTOCOL_ERROR;260 RT_CASE_RET_STR(EPROTO); 264 261 #endif 265 262 #ifdef EMULTIHOP 266 //case EMULTIHOP 72 /* Multihop attempted */263 RT_CASE_RET_STR(EMULTIHOP); 267 264 #endif 268 265 #ifdef EDOTDOT 269 //case EDOTDOT 73 /* RFS specific error */266 RT_CASE_RET_STR(EDOTDOT); 270 267 #endif 271 268 #ifdef EBADMSG 272 //case EBADMSG 74 /* Not a data message */269 RT_CASE_RET_STR(EBADMSG); 273 270 #endif 274 271 #ifdef EOVERFLOW 275 case EOVERFLOW: return VERR_TOO_MUCH_DATA; /** @todo fix duplicate error*/272 RT_CASE_RET_STR(EOVERFLOW); /** @todo fix duplicate error? */ 276 273 #endif 277 274 #ifdef ENOTUNIQ 278 case ENOTUNIQ: return VERR_NET_NOT_UNIQUE_NAME;275 RT_CASE_RET_STR(ENOTUNIQ); 279 276 #endif 280 277 #ifdef EBADFD 281 case EBADFD: return VERR_INVALID_HANDLE; /** @todo fix duplicate error? */278 RT_CASE_RET_STR(EBADFD); /** @todo fix duplicate error? */ 282 279 #endif 283 280 #ifdef EREMCHG 284 //case EREMCHG 78 /* Remote address changed */281 RT_CASE_RET_STR(EREMCHG); 285 282 #endif 286 283 #ifdef ELIBACC 287 //case ELIBACC 79 /* Can not access a needed shared library */284 RT_CASE_RET_STR(ELIBACC); 288 285 #endif 289 286 #ifdef ELIBBAD 290 //case ELIBBAD 80 /* Accessing a corrupted shared library */287 RT_CASE_RET_STR(ELIBBAD); 291 288 #endif 292 289 #ifdef ELIBSCN 293 //case ELIBSCN 81 /* .lib section in a.out corrupted */290 RT_CASE_RET_STR(ELIBSCN); 294 291 #endif 295 292 #ifdef ELIBMAX 296 //case ELIBMAX 82 /* Attempting to link in too many shared libraries */293 RT_CASE_RET_STR(ELIBMAX); 297 294 #endif 298 295 #ifdef ELIBEXEC 299 //case ELIBEXEC 83 /* Cannot exec a shared library directly */296 RT_CASE_RET_STR(ELIBEXEC); 300 297 #endif 301 298 #ifdef EILSEQ 302 case EILSEQ: return VERR_NO_TRANSLATION;299 RT_CASE_RET_STR(EILSEQ); 303 300 #endif 304 301 #ifdef ERESTART 305 case ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/302 RT_CASE_RET_STR(ERESTART);/** @todo fix duplicate error?*/ 306 303 #endif 307 304 #ifdef ESTRPIPE 308 //case ESTRPIPE 86 /* Streams pipe error */305 RT_CASE_RET_STR(ESTRPIPE); 309 306 #endif 310 307 #ifdef EUSERS 311 //case EUSERS 87 /* Too many users */308 RT_CASE_RET_STR(EUSERS); 312 309 #endif 313 310 #ifdef ENOTSOCK 314 case ENOTSOCK: return VERR_NET_NOT_SOCKET;311 RT_CASE_RET_STR(ENOTSOCK); 315 312 #endif 316 313 #ifdef EDESTADDRREQ 317 case EDESTADDRREQ: return VERR_NET_DEST_ADDRESS_REQUIRED;314 RT_CASE_RET_STR(EDESTADDRREQ); 318 315 #endif 319 316 #ifdef EMSGSIZE 320 case EMSGSIZE: return VERR_NET_MSG_SIZE;317 RT_CASE_RET_STR(EMSGSIZE); 321 318 #endif 322 319 #ifdef EPROTOTYPE 323 case EPROTOTYPE: return VERR_NET_PROTOCOL_TYPE;320 RT_CASE_RET_STR(EPROTOTYPE); 324 321 #endif 325 322 #ifdef ENOPROTOOPT 326 case ENOPROTOOPT: return VERR_NET_PROTOCOL_NOT_AVAILABLE;323 RT_CASE_RET_STR(ENOPROTOOPT); 327 324 #endif 328 325 #ifdef EPROTONOSUPPORT 329 case EPROTONOSUPPORT: return VERR_NET_PROTOCOL_NOT_SUPPORTED;326 RT_CASE_RET_STR(EPROTONOSUPPORT); 330 327 #endif 331 328 #ifdef ESOCKTNOSUPPORT 332 case ESOCKTNOSUPPORT: return VERR_NET_SOCKET_TYPE_NOT_SUPPORTED;329 RT_CASE_RET_STR(ESOCKTNOSUPPORT); 333 330 #endif 334 331 #ifdef EOPNOTSUPP /** @todo map this differently on solaris. */ 335 case EOPNOTSUPP: return VERR_NET_OPERATION_NOT_SUPPORTED;332 RT_CASE_RET_STR(EOPNOTSUPP); 336 333 #endif 337 334 #ifdef EPFNOSUPPORT 338 case EPFNOSUPPORT: return VERR_NET_PROTOCOL_FAMILY_NOT_SUPPORTED;335 RT_CASE_RET_STR(EPFNOSUPPORT); 339 336 #endif 340 337 #ifdef EAFNOSUPPORT 341 case EAFNOSUPPORT: return VERR_NET_ADDRESS_FAMILY_NOT_SUPPORTED;338 RT_CASE_RET_STR(EAFNOSUPPORT); 342 339 #endif 343 340 #ifdef EADDRINUSE 344 case EADDRINUSE: return VERR_NET_ADDRESS_IN_USE;341 RT_CASE_RET_STR(EADDRINUSE); 345 342 #endif 346 343 #ifdef EADDRNOTAVAIL 347 case EADDRNOTAVAIL: return VERR_NET_ADDRESS_NOT_AVAILABLE;344 RT_CASE_RET_STR(EADDRNOTAVAIL); 348 345 #endif 349 346 #ifdef ENETDOWN 350 case ENETDOWN: return VERR_NET_DOWN;347 RT_CASE_RET_STR(ENETDOWN); 351 348 #endif 352 349 #ifdef ENETUNREACH 353 case ENETUNREACH: return VERR_NET_UNREACHABLE;350 RT_CASE_RET_STR(ENETUNREACH); 354 351 #endif 355 352 #ifdef ENETRESET 356 case ENETRESET: return VERR_NET_CONNECTION_RESET;353 RT_CASE_RET_STR(ENETRESET); 357 354 #endif 358 355 #ifdef ECONNABORTED 359 case ECONNABORTED: return VERR_NET_CONNECTION_ABORTED;356 RT_CASE_RET_STR(ECONNABORTED); 360 357 #endif 361 358 #ifdef ECONNRESET 362 case ECONNRESET: return VERR_NET_CONNECTION_RESET_BY_PEER;359 RT_CASE_RET_STR(ECONNRESET); 363 360 #endif 364 361 #ifdef ENOBUFS 365 case ENOBUFS: return VERR_NET_NO_BUFFER_SPACE;362 RT_CASE_RET_STR(ENOBUFS); 366 363 #endif 367 364 #ifdef EISCONN 368 case EISCONN: return VERR_NET_ALREADY_CONNECTED;365 RT_CASE_RET_STR(EISCONN); 369 366 #endif 370 367 #ifdef ENOTCONN 371 case ENOTCONN: return VERR_NET_NOT_CONNECTED;368 RT_CASE_RET_STR(ENOTCONN); 372 369 #endif 373 370 #ifdef ESHUTDOWN 374 case ESHUTDOWN: return VERR_NET_SHUTDOWN;371 RT_CASE_RET_STR(ESHUTDOWN); 375 372 #endif 376 373 #ifdef ETOOMANYREFS 377 case ETOOMANYREFS: return VERR_NET_TOO_MANY_REFERENCES;374 RT_CASE_RET_STR(ETOOMANYREFS); 378 375 #endif 379 376 #ifdef ETIMEDOUT 380 case ETIMEDOUT: return VERR_TIMEOUT;377 RT_CASE_RET_STR(ETIMEDOUT); 381 378 #endif 382 379 #ifdef ECONNREFUSED 383 case ECONNREFUSED: return VERR_NET_CONNECTION_REFUSED;380 RT_CASE_RET_STR(ECONNREFUSED); 384 381 #endif 385 382 #ifdef EHOSTDOWN 386 case EHOSTDOWN: return VERR_NET_HOST_DOWN;383 RT_CASE_RET_STR(EHOSTDOWN); 387 384 #endif 388 385 #ifdef EHOSTUNREACH 389 case EHOSTUNREACH: return VERR_NET_HOST_UNREACHABLE;386 RT_CASE_RET_STR(EHOSTUNREACH); 390 387 #endif 391 388 #ifdef EALREADY 392 389 # if !defined(ENOLCK) || (EALREADY != ENOLCK) 393 case EALREADY: return VERR_NET_ALREADY_IN_PROGRESS;390 RT_CASE_RET_STR(EALREADY); 394 391 # endif 395 392 #endif 396 393 #ifdef EINPROGRESS 397 394 # if !defined(ENODEV) || (EINPROGRESS != ENODEV) 398 case EINPROGRESS: return VERR_NET_IN_PROGRESS;395 RT_CASE_RET_STR(EINPROGRESS); 399 396 # endif 400 397 #endif 401 398 #ifdef ESTALE 402 case ESTALE: return VERR_STALE_FILE_HANDLE; /* 116: Stale NFS file handle */399 RT_CASE_RET_STR(ESTALE); /* 116: Stale NFS file handle */ 403 400 #endif 404 401 #ifdef EUCLEAN 405 //case EUCLEAN 117 /* Structure needs cleaning */402 RT_CASE_RET_STR(EUCLEAN); 406 403 #endif 407 404 #ifdef ENOTNAM 408 //case ENOTNAM 118 /* Not a XENIX named type file */405 RT_CASE_RET_STR(ENOTNAM); 409 406 #endif 410 407 #ifdef ENAVAIL 411 //case ENAVAIL 119 /* No XENIX semaphores available */408 RT_CASE_RET_STR(ENAVAIL); 412 409 #endif 413 410 #ifdef EISNAM 414 //case EISNAM 120 /* Is a named type file */411 RT_CASE_RET_STR(EISNAM); 415 412 #endif 416 413 #ifdef EREMOTEIO 417 //case EREMOTEIO 121 /* Remote I/O error */414 RT_CASE_RET_STR(EREMOTEIO); 418 415 #endif 419 416 #ifdef EDQUOT 420 case EDQUOT: return VERR_DISK_FULL; /** @todo fix duplicate error */417 RT_CASE_RET_STR(EDQUOT); /** @todo fix duplicate error */ 421 418 #endif 422 419 #ifdef ENOMEDIUM 423 case ENOMEDIUM: return VERR_MEDIA_NOT_PRESENT;420 RT_CASE_RET_STR(ENOMEDIUM); 424 421 #endif 425 422 #ifdef EMEDIUMTYPE 426 case EMEDIUMTYPE: return VERR_MEDIA_NOT_RECOGNIZED;423 RT_CASE_RET_STR(EMEDIUMTYPE); 427 424 #endif 428 425 #if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN) 429 case EWOULDBLOCK: return VERR_TRY_AGAIN;426 RT_CASE_RET_STR(EWOULDBLOCK); 430 427 #endif 431 428 … … 433 430 434 431 #ifdef EPROCLIM 435 case EPROCLIM: return VERR_MAX_PROCS_REACHED;432 RT_CASE_RET_STR(EPROCLIM); 436 433 #endif 437 434 #ifdef EDOOFUS 438 435 # if EDOOFUS != EINVAL 439 case EDOOFUS: return VERR_INTERNAL_ERROR;436 RT_CASE_RET_STR(EDOOFUS); 440 437 # endif 441 438 #endif 442 439 #ifdef ENOTSUP 443 440 # ifndef EOPNOTSUPP 444 case ENOTSUP: return VERR_NOT_SUPPORTED;441 RT_CASE_RET_STR(ENOTSUP); 445 442 # else 446 443 # if ENOTSUP != EOPNOTSUPP 447 case ENOTSUP: return VERR_NOT_SUPPORTED;444 RT_CASE_RET_STR(ENOTSUP); 448 445 # endif 449 446 # endif 450 447 #endif 451 448 default: 452 AssertLogRelMsgFailed(("Unhandled error code %d\n", iNativeCode)); 453 return VERR_UNRESOLVED_ERROR; 449 AssertLogRelMsgFailedReturn(("Unhandled error code %d\n", iErrNo), "unknown-errno-value"); 454 450 } 455 451 } 456 RT_ EXPORT_SYMBOL(RTErrConvertFromErrno);457 452 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strerror); 453
Note:
See TracChangeset
for help on using the changeset viewer.