Emulate Linux socket timeout signaling on Windows

This commit is contained in:
Justine Tunney 2024-09-17 00:24:08 -07:00
parent 65e425fbca
commit b14dddcc18
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 246 additions and 29 deletions

View file

@ -191,6 +191,11 @@ __winsock_block(int64_t handle, uint32_t flags, int nonblock,
// check if signal handler without SA_RESTART was called
if (handler_was_called & SIG_HANDLED_NO_RESTART)
return eintr();
// emulates linux behavior of having timeouts @norestart
if (handler_was_called & SIG_HANDLED_SA_RESTART)
if (srwtimeout)
return eintr();
}
// otherwise try the i/o operation again