Reactos
at master 150 lines 6.3 kB view raw
1/*** 2*syserr.c - system error list 3* 4* Copyright (c) Microsoft Corporation. All rights reserved. 5* 6*Purpose: 7* Defines the System Error List, containing the full messages for 8* all errno values set by the library routines. 9* Defines sys_errlist, sys_nerr. 10* 11*******************************************************************************/ 12#include <corecrt_internal.h> 13#include <stdlib.h> 14 15#undef _sys_nerr 16#undef _sys_errlist 17 18extern "C" char const* const _sys_errlist[] = 19{ 20 /* 0 */ "No error", 21 /* 1 EPERM */ "Operation not permitted", 22 /* 2 ENOENT */ "No such file or directory", 23 /* 3 ESRCH */ "No such process", 24 /* 4 EINTR */ "Interrupted function call", 25 /* 5 EIO */ "Input/output error", 26 /* 6 ENXIO */ "No such device or address", 27 /* 7 E2BIG */ "Arg list too long", 28 /* 8 ENOEXEC */ "Exec format error", 29 /* 9 EBADF */ "Bad file descriptor", 30 /* 10 ECHILD */ "No child processes", 31 /* 11 EAGAIN */ "Resource temporarily unavailable", 32 /* 12 ENOMEM */ "Not enough space", 33 /* 13 EACCES */ "Permission denied", 34 /* 14 EFAULT */ "Bad address", 35 /* 15 ENOTBLK */ "Unknown error", /* not POSIX */ 36 /* 16 EBUSY */ "Resource device", 37 /* 17 EEXIST */ "File exists", 38 /* 18 EXDEV */ "Improper link", 39 /* 19 ENODEV */ "No such device", 40 /* 20 ENOTDIR */ "Not a directory", 41 /* 21 EISDIR */ "Is a directory", 42 /* 22 EINVAL */ "Invalid argument", 43 /* 23 ENFILE */ "Too many open files in system", 44 /* 24 EMFILE */ "Too many open files", 45 /* 25 ENOTTY */ "Inappropriate I/O control operation", 46 /* 26 ETXTBSY */ "Unknown error", /* not POSIX */ 47 /* 27 EFBIG */ "File too large", 48 /* 28 ENOSPC */ "No space left on device", 49 /* 29 ESPIPE */ "Invalid seek", 50 /* 30 EROFS */ "Read-only file system", 51 /* 31 EMLINK */ "Too many links", 52 /* 32 EPIPE */ "Broken pipe", 53 /* 33 EDOM */ "Domain error", 54 /* 34 ERANGE */ "Result too large", 55 /* 35 EUCLEAN */ "Unknown error", /* not POSIX */ 56 /* 36 EDEADLK */ "Resource deadlock avoided", 57 /* 37 UNKNOWN */ "Unknown error", 58 /* 38 ENAMETOOLONG */ "Filename too long", 59 /* 39 ENOLCK */ "No locks available", 60 /* 40 ENOSYS */ "Function not implemented", 61 /* 41 ENOTEMPTY */ "Directory not empty", 62 /* 42 EILSEQ */ "Illegal byte sequence", 63 /* 43 */ "Unknown error" 64}; 65 66extern "C" char const* const _sys_posix_errlist[] = 67{ 68 /* 100 EADDRINUSE */ "address in use", 69 /* 101 EADDRNOTAVAIL */ "address not available", 70 /* 102 EAFNOSUPPORT */ "address family not supported", 71 /* 103 EALREADY */ "connection already in progress", 72 /* 104 EBADMSG */ "bad message", 73 /* 105 ECANCELED */ "operation canceled", 74 /* 106 ECONNABORTED */ "connection aborted", 75 /* 107 ECONNREFUSED */ "connection refused", 76 /* 108 ECONNRESET */ "connection reset", 77 /* 109 EDESTADDRREQ */ "destination address required", 78 /* 110 EHOSTUNREACH */ "host unreachable", 79 /* 111 EIDRM */ "identifier removed", 80 /* 112 EINPROGRESS */ "operation in progress", 81 /* 113 EISCONN */ "already connected", 82 /* 114 ELOOP */ "too many symbolic link levels", 83 /* 115 EMSGSIZE */ "message size", 84 /* 116 ENETDOWN */ "network down", 85 /* 117 ENETRESET */ "network reset", 86 /* 118 ENETUNREACH */ "network unreachable", 87 /* 119 ENOBUFS */ "no buffer space", 88 /* 120 ENODATA */ "no message available", 89 /* 121 ENOLINK */ "no link", 90 /* 122 ENOMSG */ "no message", 91 /* 123 ENOPROTOOPT */ "no protocol option", 92 /* 124 ENOSR */ "no stream resources", 93 /* 125 ENOSTR */ "not a stream", 94 /* 126 ENOTCONN */ "not connected", 95 /* 127 ENOTRECOVERABLE */ "state not recoverable", 96 /* 128 ENOTSOCK */ "not a socket", 97 /* 129 ENOTSUP */ "not supported", 98 /* 130 EOPNOTSUPP */ "operation not supported", 99 /* 131 EOTHER */ "Unknown error", 100 /* 132 EOVERFLOW */ "value too large", 101 /* 133 EOWNERDEAD */ "owner dead", 102 /* 134 EPROTO */ "protocol error", 103 /* 135 EPROTONOSUPPORT */ "protocol not supported", 104 /* 136 EPROTOTYPE */ "wrong protocol type", 105 /* 137 ETIME */ "stream timeout", 106 /* 138 ETIMEDOUT */ "timed out", 107 /* 139 ETXTBSY */ "text file busy", 108 /* 140 EWOULDBLOCK */ "operation would block", 109 /* 141 */ "Unknown error" 110}; 111 112 113extern "C" size_t const _sys_first_posix_error = 100; 114extern "C" size_t const _sys_last_posix_error = _sys_first_posix_error + _countof(_sys_posix_errlist) - 1; 115extern "C" int const _sys_nerr = _countof(_sys_errlist) - 1; 116 117// The above array contains all the errors including unknown error 118 119 120/* ***NOTE: Global variable max_system_error_message_count (in file corecrt_internal.h) 121 indicates the length of the longest system error message in the above table. 122 When you add or modify a message, you must update the value 123 max_system_error_message_count, if appropriate. */ 124 125/*** 126*int * __sys_nerr(); - return pointer to thread's errno 127*const char * const * __cdecl __sys_errlist(void); - return pointer to thread's _doserrno 128* 129*Purpose: 130* Returns former global variables 131* 132*Entry: 133* None. 134* 135*Exit: 136* See above. 137* 138*Exceptions: 139* 140*******************************************************************************/ 141 142extern "C" int* __cdecl __sys_nerr() 143{ 144 return const_cast<int*>(&_sys_nerr); 145} 146 147extern "C" char** __cdecl __sys_errlist() 148{ 149 return const_cast<char**>(_sys_errlist); 150}