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,15 @@
#include "libc/calls/struct/timespec.h"
#include "libc/sysv/consts/clock.h"
/**
* Returns current time.
*
* This function uses a `CLOCK_REALTIME` clock and never fails. Unlike
* clock_gettime() or timespec_real() this interface avoids the use of
* pointers which lets time handling code become more elegant.
*
* @see _timespec_mono()
*/
struct timespec _timespec_real(void) {
struct timespec ts;
_npassert(!clock_gettime(CLOCK_REALTIME_FAST, &ts));