diff options
author | 2021-01-07 15:24:52 +0000 | |
---|---|---|
committer | 2021-01-07 15:24:52 +0000 | |
commit | 7f7a9cc45e2a9c0cfe79d6a7cec6cc1cdb950c44 (patch) | |
tree | 9af62823c5a0697c025e849e112c549d14bf2208 /lib/libssl/ssl_both.c | |
parent | Extend IP_ADD_MEMBERSHIP to also support struct ip_mreqn. (diff) | |
download | wireguard-openbsd-7f7a9cc45e2a9c0cfe79d6a7cec6cc1cdb950c44.tar.xz wireguard-openbsd-7f7a9cc45e2a9c0cfe79d6a7cec6cc1cdb950c44.zip |
sleep(3): don't bypass nanosleep(2) if seconds is zero
sleep(3) does not call nanosleep(2) if seconds is zero. This is bad.
As a simplified interface to nanosleep(2), sleep(3) should delegate
all decisions about whether or not to yield the CPU to nanosleep(2).
This patch removes the nanosleep(2) bypass from sleep(3).
This means that this code:
sleep(0);
will block for up to 1 tick, just like the equivalent nanosleep(2) call.
Neither FreeBSD nor NetBSD bypass nanosleep(2) in the zero case, so
this commit brings our sleep(3) closer to theirs in behavior.
As an added bonus, sleep(3) will now *always* appear in a ktrace(1) as
a call to nanosleep(2).
ok millert@
Diffstat (limited to 'lib/libssl/ssl_both.c')
0 files changed, 0 insertions, 0 deletions