version 1.1, 2012/05/29 09:29:43
|
version 1.1.1.2, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
/* strerror-override.c --- POSIX compatible system error routine |
/* strerror-override.c --- POSIX compatible system error routine |
|
|
Copyright (C) 2010-2011 Free Software Foundation, Inc. | Copyright (C) 2010-2019 Free Software Foundation, Inc. |
|
|
This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
Line 13
|
Line 13
|
GNU General Public License for more details. |
GNU General Public License for more details. |
|
|
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
|
|
/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ |
/* Written by Bruno Haible <bruno@clisp.org>, 2010. */ |
|
|
Line 23
|
Line 23
|
|
|
#include <errno.h> |
#include <errno.h> |
|
|
#if GNULIB_defined_ESOCK /* native Windows platforms */ | #if GNULIB_defined_EWINSOCK /* native Windows platforms */ |
# if HAVE_WINSOCK2_H |
# if HAVE_WINSOCK2_H |
# include <winsock2.h> |
# include <winsock2.h> |
# endif |
# endif |
Line 42 strerror_override (int errnum)
|
Line 42 strerror_override (int errnum)
|
return "Success"; |
return "Success"; |
#endif |
#endif |
|
|
#if GNULIB_defined_ETXTBSY | #if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */ |
case ETXTBSY: | |
return "Text file busy"; | |
#endif | |
| |
#if GNULIB_defined_ESOCK /* native Windows platforms */ | |
/* EWOULDBLOCK is the same as EAGAIN. */ | |
case EINPROGRESS: |
case EINPROGRESS: |
return "Operation now in progress"; |
return "Operation now in progress"; |
case EALREADY: |
case EALREADY: |
Line 65 strerror_override (int errnum)
|
Line 59 strerror_override (int errnum)
|
return "Protocol not available"; |
return "Protocol not available"; |
case EPROTONOSUPPORT: |
case EPROTONOSUPPORT: |
return "Protocol not supported"; |
return "Protocol not supported"; |
case ESOCKTNOSUPPORT: |
|
return "Socket type not supported"; |
|
case EOPNOTSUPP: |
case EOPNOTSUPP: |
return "Operation not supported"; |
return "Operation not supported"; |
case EPFNOSUPPORT: |
|
return "Protocol family not supported"; |
|
case EAFNOSUPPORT: |
case EAFNOSUPPORT: |
return "Address family not supported by protocol"; |
return "Address family not supported by protocol"; |
case EADDRINUSE: |
case EADDRINUSE: |
Line 81 strerror_override (int errnum)
|
Line 71 strerror_override (int errnum)
|
return "Network is down"; |
return "Network is down"; |
case ENETUNREACH: |
case ENETUNREACH: |
return "Network is unreachable"; |
return "Network is unreachable"; |
case ENETRESET: |
|
return "Network dropped connection on reset"; |
|
case ECONNABORTED: |
|
return "Software caused connection abort"; |
|
case ECONNRESET: |
case ECONNRESET: |
return "Connection reset by peer"; |
return "Connection reset by peer"; |
case ENOBUFS: |
case ENOBUFS: |
Line 93 strerror_override (int errnum)
|
Line 79 strerror_override (int errnum)
|
return "Transport endpoint is already connected"; |
return "Transport endpoint is already connected"; |
case ENOTCONN: |
case ENOTCONN: |
return "Transport endpoint is not connected"; |
return "Transport endpoint is not connected"; |
case ESHUTDOWN: |
|
return "Cannot send after transport endpoint shutdown"; |
|
case ETOOMANYREFS: |
|
return "Too many references: cannot splice"; |
|
case ETIMEDOUT: |
case ETIMEDOUT: |
return "Connection timed out"; |
return "Connection timed out"; |
case ECONNREFUSED: |
case ECONNREFUSED: |
return "Connection refused"; |
return "Connection refused"; |
case ELOOP: |
case ELOOP: |
return "Too many levels of symbolic links"; |
return "Too many levels of symbolic links"; |
case EHOSTDOWN: |
|
return "Host is down"; |
|
case EHOSTUNREACH: |
case EHOSTUNREACH: |
return "No route to host"; |
return "No route to host"; |
|
case EWOULDBLOCK: |
|
return "Operation would block"; |
|
#endif |
|
#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */ |
|
case ETXTBSY: |
|
return "Text file busy"; |
|
case ENODATA: |
|
return "No data available"; |
|
case ENOSR: |
|
return "Out of streams resources"; |
|
case ENOSTR: |
|
return "Device not a stream"; |
|
case ETIME: |
|
return "Timer expired"; |
|
case EOTHER: |
|
return "Other error"; |
|
#endif |
|
#if GNULIB_defined_EWINSOCK /* native Windows platforms */ |
|
case ESOCKTNOSUPPORT: |
|
return "Socket type not supported"; |
|
case EPFNOSUPPORT: |
|
return "Protocol family not supported"; |
|
case ESHUTDOWN: |
|
return "Cannot send after transport endpoint shutdown"; |
|
case ETOOMANYREFS: |
|
return "Too many references: cannot splice"; |
|
case EHOSTDOWN: |
|
return "Host is down"; |
case EPROCLIM: |
case EPROCLIM: |
return "Too many processes"; |
return "Too many processes"; |
case EUSERS: |
case EUSERS: |
Line 134 strerror_override (int errnum)
|
Line 142 strerror_override (int errnum)
|
/* WSAEINVAL maps to EINVAL */ |
/* WSAEINVAL maps to EINVAL */ |
/* WSAEMFILE maps to EMFILE */ |
/* WSAEMFILE maps to EMFILE */ |
/* WSAEWOULDBLOCK maps to EWOULDBLOCK */ |
/* WSAEWOULDBLOCK maps to EWOULDBLOCK */ |
/* WSAEINPROGRESS is EINPROGRESS */ | /* WSAEINPROGRESS maps to EINPROGRESS */ |
/* WSAEALREADY is EALREADY */ | /* WSAEALREADY maps to EALREADY */ |
/* WSAENOTSOCK is ENOTSOCK */ | /* WSAENOTSOCK maps to ENOTSOCK */ |
/* WSAEDESTADDRREQ is EDESTADDRREQ */ | /* WSAEDESTADDRREQ maps to EDESTADDRREQ */ |
/* WSAEMSGSIZE is EMSGSIZE */ | /* WSAEMSGSIZE maps to EMSGSIZE */ |
/* WSAEPROTOTYPE is EPROTOTYPE */ | /* WSAEPROTOTYPE maps to EPROTOTYPE */ |
/* WSAENOPROTOOPT is ENOPROTOOPT */ | /* WSAENOPROTOOPT maps to ENOPROTOOPT */ |
/* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */ | /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */ |
/* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ |
/* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ |
/* WSAEOPNOTSUPP is EOPNOTSUPP */ | /* WSAEOPNOTSUPP maps to EOPNOTSUPP */ |
/* WSAEPFNOSUPPORT is EPFNOSUPPORT */ |
/* WSAEPFNOSUPPORT is EPFNOSUPPORT */ |
/* WSAEAFNOSUPPORT is EAFNOSUPPORT */ | /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */ |
/* WSAEADDRINUSE is EADDRINUSE */ | /* WSAEADDRINUSE maps to EADDRINUSE */ |
/* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */ | /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */ |
/* WSAENETDOWN is ENETDOWN */ | /* WSAENETDOWN maps to ENETDOWN */ |
/* WSAENETUNREACH is ENETUNREACH */ | /* WSAENETUNREACH maps to ENETUNREACH */ |
/* WSAENETRESET is ENETRESET */ | /* WSAENETRESET maps to ENETRESET */ |
/* WSAECONNABORTED is ECONNABORTED */ | /* WSAECONNABORTED maps to ECONNABORTED */ |
/* WSAECONNRESET is ECONNRESET */ | /* WSAECONNRESET maps to ECONNRESET */ |
/* WSAENOBUFS is ENOBUFS */ | /* WSAENOBUFS maps to ENOBUFS */ |
/* WSAEISCONN is EISCONN */ | /* WSAEISCONN maps to EISCONN */ |
/* WSAENOTCONN is ENOTCONN */ | /* WSAENOTCONN maps to ENOTCONN */ |
/* WSAESHUTDOWN is ESHUTDOWN */ |
/* WSAESHUTDOWN is ESHUTDOWN */ |
/* WSAETOOMANYREFS is ETOOMANYREFS */ |
/* WSAETOOMANYREFS is ETOOMANYREFS */ |
/* WSAETIMEDOUT is ETIMEDOUT */ | /* WSAETIMEDOUT maps to ETIMEDOUT */ |
/* WSAECONNREFUSED is ECONNREFUSED */ | /* WSAECONNREFUSED maps to ECONNREFUSED */ |
/* WSAELOOP is ELOOP */ | /* WSAELOOP maps to ELOOP */ |
/* WSAENAMETOOLONG maps to ENAMETOOLONG */ |
/* WSAENAMETOOLONG maps to ENAMETOOLONG */ |
/* WSAEHOSTDOWN is EHOSTDOWN */ |
/* WSAEHOSTDOWN is EHOSTDOWN */ |
/* WSAEHOSTUNREACH is EHOSTUNREACH */ | /* WSAEHOSTUNREACH maps to EHOSTUNREACH */ |
/* WSAENOTEMPTY maps to ENOTEMPTY */ |
/* WSAENOTEMPTY maps to ENOTEMPTY */ |
/* WSAEPROCLIM is EPROCLIM */ |
/* WSAEPROCLIM is EPROCLIM */ |
/* WSAEUSERS is EUSERS */ |
/* WSAEUSERS is EUSERS */ |
Line 271 strerror_override (int errnum)
|
Line 279 strerror_override (int errnum)
|
#if GNULIB_defined_ECANCELED |
#if GNULIB_defined_ECANCELED |
case ECANCELED: |
case ECANCELED: |
return "Operation canceled"; |
return "Operation canceled"; |
|
#endif |
|
|
|
#if GNULIB_defined_EOWNERDEAD |
|
case EOWNERDEAD: |
|
return "Owner died"; |
|
#endif |
|
|
|
#if GNULIB_defined_ENOTRECOVERABLE |
|
case ENOTRECOVERABLE: |
|
return "State not recoverable"; |
|
#endif |
|
|
|
#if GNULIB_defined_EILSEQ |
|
case EILSEQ: |
|
return "Invalid or incomplete multibyte or wide character"; |
#endif |
#endif |
|
|
default: |
default: |