Fix futimes() regression

Fixes #647
This commit is contained in:
Justine Tunney 2022-10-05 19:25:07 -07:00
parent f155205eb0
commit 81ee11a16e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
22 changed files with 200 additions and 138 deletions

View file

@ -20,6 +20,14 @@
/**
* Reduces `ts` from 1e-9 to 1e-6 granularity w/ ceil rounding.
*
* This function uses ceiling rounding. For example, if `ts` is one
* nanosecond, then one microsecond will be returned. Ceil rounding
* is needed by many interfaces, e.g. setitimer(), because the zero
* timestamp has a special meaning.
*
* @return microseconds since epoch
* @see _timespec_tomicros()
*/
struct timeval _timespec_totimeval(struct timespec ts) {
if (ts.tv_nsec < 1000000000 - 999) {