libluna: Add a bunch more errno definitions

This commit is contained in:
apio 2023-08-11 17:59:41 +02:00
parent 5a1adcb2a6
commit 5ea73197ad
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 84 additions and 60 deletions

View File

@ -46,17 +46,25 @@
#define EILSEQ 84 // Invalid or incomplete multibyte or wide character
#define ENOTSOCK 88 // Socket operation on non-socket
#define EDESTADDRREQ 89 // Destination address required
#define EMSGSIZE 90 // Message too long
#define EPROTOTYPE 91 // Protocol wrong type for socket
#define ENOPROTOOPT 92 // Protocol not available
#define EPROTONOSUPPORT 93 // Protocol not supported
#define ENOTSUP 95 // Operation not supported
#define EOPNOTSUPP 95 // Operation not supported
#define EAFNOSUPPORT 97 // Address family not supported by protocol
#define EADDRINUSE 98 // Address already in use
#define EADDRNOTAVAIL 99 // Cannot assign requested address
#define ENETDOWN 100 // Network is down
#define ENETUNREACH 101 // Network is unreachable
#define ENETRESET 102 // Network dropped connection on reset
#define ECONNABORTED 103 // Software caused connection abort
#define ECONNRESET 104 // Connection reset by peer
#define ENOBUFS 105 // No buffer space available
#define EISCONN 106 // Transport endpoint is already connected
#define ENOTCONN 107 // Transport endpoint is not connected
#define ETIMEDOUT 110 // Connection timed out
#define ECONNREFUSED 111 // Connection refused
#define EHOSTUNREACH 113 // No route to host
#define EALREADY 114 // Operation already in progress
#define EINPROGRESS 115 // Operation now in progress

View File

@ -63,6 +63,14 @@ const char* error_string(int error)
case EADDRNOTAVAIL: return "Cannot assign requested address";
case ECONNREFUSED: return "Connection refused";
case EINPROGRESS: return "Operation now in progress";
case ECONNABORTED: return "Software caused connection abort";
case EHOSTUNREACH: return "No route to host";
case EMSGSIZE: return "Message too long";
case ENETDOWN: return "Network is down";
case ENETUNREACH: return "Network is unreachable";
case ENOBUFS: return "No buffer space available";
case ENOPROTOOPT: return "Protocol not available";
case EPROTONOSUPPORT: return "Protocol not supported";
default: return "Unknown error";
}
}
@ -132,6 +140,14 @@ const char* error_name(int error)
ERROR(EADDRNOTAVAIL);
ERROR(ECONNREFUSED);
ERROR(EINPROGRESS);
ERROR(ECONNABORTED);
ERROR(EHOSTUNREACH);
ERROR(EMSGSIZE);
ERROR(ENETDOWN);
ERROR(ENETUNREACH);
ERROR(ENOBUFS);
ERROR(ENOPROTOOPT);
ERROR(EPROTONOSUPPORT);
default: return nullptr;
}