OSDN Git Service

add fallback emulation for accept4 on old kernels
authorRich Felker <dalias@aerifal.cx>
Sat, 22 Feb 2014 03:25:26 +0000 (22:25 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 22 Feb 2014 03:25:26 +0000 (22:25 -0500)
commitdc01e2cbfb290198c03514fe51ed32c1098b774f
tree79357e35a582f1fea0012d1c9ff1faf4403c2c0e
parentfdb3efa5ddfa7120de98f8ae78b5f5dc9e8e2e71
add fallback emulation for accept4 on old kernels

the other atomic FD_CLOEXEC interfaces (dup3, pipe2, socket) already
had such emulation in place. the justification for doing the emulation
here is the same as for the other functions: it allows applications to
simply use accept4 rather than having to have their own fallback code
for ENOSYS/EINVAL (which one you get is arch-specific!) and there is
no reasonable way an application could benefit from knowing the
operation is emulated/non-atomic since there is no workaround at the
application level for non-atomicity (that is the whole reason these
interfaces were added).
src/network/accept4.c