Skip to content

Commit

Permalink
LibC: Make EWOULDBLOCK an alias for EAGAIN
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gunnarbeutner authored and linusg committed May 1, 2021
1 parent 03f4c48 commit a9f488c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Userland/Libraries/LibC/errno_numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ enum ErrnoCode {
#define ENOPROTOOPT ENOPROTOOPT
ENOTCONN,
#define ENOTCONN ENOTCONN
EWOULDBLOCK,
#define EWOULDBLOCK EWOULDBLOCK
EPROTONOSUPPORT,
#define EPROTONOSUPPORT EPROTONOSUPPORT
EDEADLK,
Expand All @@ -158,3 +156,5 @@ enum ErrnoCode {
EMAXERRNO,
#define EMAXERRNO EMAXERRNO
};

#define EWOULDBLOCK EAGAIN
1 change: 0 additions & 1 deletion Userland/Libraries/LibC/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ const char* const sys_errlist[] = {
"No message",
"No protocol option",
"Not connected",
"Operation would block",
"Protocol not supported",
"Resource deadlock would occur",
"Timed out",
Expand Down

0 comments on commit a9f488c

Please sign in to comment.