errno-util: add new ERRNO_IS_ACCEPT_AGAIN() test
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Apr 2019 17:40:40 +0000 (19:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Apr 2019 18:03:38 +0000 (20:03 +0200)
commitfb0302ddbc47f61349286abfe7fbaa12c7069e25
tree7f1999c9892d0fdcbd584ad7249dd3e218517c58
parent7f000106012f2e641b5fd0604f6668e61a0f44c7
errno-util: add new ERRNO_IS_ACCEPT_AGAIN() test

This is modelled after the existing ERRNO_IS_RESOURCES() and in
particular ERRNO_IS_DISCONNECT(). It returns true for all transient
network errors that should be handled like EAGAIN whenever we call
accept() or accept4(). This is per documentation in the accept(2) man
page that explicitly says to do so in the its "RETURN VALUE" section.

The error list we cover is a bit more comprehensive, and based on
existing code of ours. For example EINTR is included too (since we need
that to cover cases where we call accept()/accept4() on a blocking
socket), and of course ERRNO_IS_DISCONNECT() is a bit more comprehensive
than the list in the man page too.
src/basic/errno-util.h