bitwiseworks / libcx

kLIBC Extension Library
GNU Lesser General Public License v2.1
11 stars 1 forks source link

select: Implement EBADF and EFAULT hacks #85

Closed dmik closed 4 years ago

dmik commented 4 years ago

It is known (from runtime analysis) that OS/2 TCP/IP select has two strange bug-o-features:

  1. It tends to return EBADF if the other end of the socket pair unexpectedly dies (i.e. crashes).
  2. It tends to return EFAULT under heavy load.

The first problem was once worked around in Mozilla and libevent (see a9f0d97 and https://github.com/bitwiseworks/libevent-os2/issues/2 for details). The second problem is worked around by Silvan/Paul around in CUPS (https://github.com/bitwiseworks/cups-os2/blob/5129c6eae25925e29072fb586fa2dbd3cdfa398e/scheduler/select.c#L618).

It makes sense to move both fixes to LIBCx select override so that any LIBCx linked app would benefit from that.