CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2020/01/11 17:01:12
Modified files:
sys/kern : kern_synch.c
share/man/man9 : tsleep.9
Log message:
*sleep_nsec(9): sleep *at least* the given number of nanoseconds
The *sleep(9) interfaces are challenging to use when one needs to sleep
for a given minimum duration: the programmer needs to account for both
the current tick and any integer division when converting an interval
to a count of ticks. This sort of input conversion is complicated and
ugly at best and error-prone at worst.
This patch consolidates this conversion logic into the *sleep_nsec(9)
functions themselves. This will allow us to use the functions at the
syscall layer and elsewhere in the kernel where guaranteeing a minimum
sleep duration is of vital importance.
With input from bluhm@, guenther@, ratchov@, tedu@, and kettenis@.
Requested by mpi@ and kettenis@.
Conversion algorithm from mpi@.
ok mpi@, kettenis@, deraadt@