To avoid incompatibilities check for Linux/posix also for EAGAIN and not only for EWOULDBLOCK.
man:
EAGAIN or EWOULDBLOCK
The socket is marked nonblocking and no connections are
present to be accepted. POSIX.1-2001 and POSIX.1-2008
allow either error to be returned for this case, and do
not require these constants to have the same value, so a
portable application should check for both possibilities.
duplicate case solved: EWOULDBLOCK is usually binary identical to EAGAIN