mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Fix select() on Linux
This fixes a bug where the caller's timeval will be clobbered on Linux. The Kernel ABI *always* modifies the timeout argument but POSIX says it should be a const parameter. The wrapper now handles the difference and sys_select() may be used if obtaining the remainder on Linux is needed.
This commit is contained in:
parent
dfabcd84c1
commit
0f1ead8943
2 changed files with 17 additions and 6 deletions
|
@ -212,7 +212,7 @@ static bool ShouldUseSpinNanosleep(int clock, int flags,
|
|||
* while (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &abs, 0));
|
||||
*
|
||||
* will accurately spin on `EINTR` errors. That way you're not impeding
|
||||
* signal delivery and you're not losing precision on your wait timeout.
|
||||
* signal delivery and you're not loosing precision on the wait timeout.
|
||||
* This function has first-class support on Linux, FreeBSD, and NetBSD;
|
||||
* on OpenBSD it's good; on XNU it's bad; and on Windows it's ugly.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue