LibC: Make EWOULDBLOCK an alias for EAGAIN

According to POSIX.1 all error codes have to be distinct - with
the exception for EAGAIN and EWOULDBLOCK. Other libcs including
eglibc and newlib define EWOULDBLOCK as an alias for EAGAIN and
some software including OpenTTD expect this behavior.
This commit is contained in:
Gunnar Beutner 2021-04-30 12:10:09 +02:00 committed by Linus Groh
parent 03f4c48de1
commit a9f488c55b
2 changed files with 2 additions and 3 deletions

View file

@ -133,8 +133,6 @@ enum ErrnoCode {
#define ENOPROTOOPT ENOPROTOOPT #define ENOPROTOOPT ENOPROTOOPT
ENOTCONN, ENOTCONN,
#define ENOTCONN ENOTCONN #define ENOTCONN ENOTCONN
EWOULDBLOCK,
#define EWOULDBLOCK EWOULDBLOCK
EPROTONOSUPPORT, EPROTONOSUPPORT,
#define EPROTONOSUPPORT EPROTONOSUPPORT #define EPROTONOSUPPORT EPROTONOSUPPORT
EDEADLK, EDEADLK,
@ -158,3 +156,5 @@ enum ErrnoCode {
EMAXERRNO, EMAXERRNO,
#define EMAXERRNO EMAXERRNO #define EMAXERRNO EMAXERRNO
}; };
#define EWOULDBLOCK EAGAIN

View file

@ -338,7 +338,6 @@ const char* const sys_errlist[] = {
"No message", "No message",
"No protocol option", "No protocol option",
"Not connected", "Not connected",
"Operation would block",
"Protocol not supported", "Protocol not supported",
"Resource deadlock would occur", "Resource deadlock would occur",
"Timed out", "Timed out",