diff options
Diffstat (limited to 'src/xtime.c')
-rw-r--r-- | src/xtime.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/xtime.c b/src/xtime.c index 186651b..dd9b60f 100644 --- a/src/xtime.c +++ b/src/xtime.c @@ -1,11 +1,12 @@ // Copyright © Tavian Barnes <tavianator@tavianator.com> // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "xtime.h" + +#include "bfs.h" #include "bfstd.h" #include "diag.h" -#include "sanity.h" + #include <errno.h> #include <limits.h> #include <sys/time.h> @@ -36,7 +37,7 @@ int xmktime(struct tm *tm, time_t *timep) { } // FreeBSD is missing an interceptor -#if BFS_HAS_TIMEGM && !(__FreeBSD__ && SANITIZE_MEMORY) +#if BFS_HAS_TIMEGM && !(__FreeBSD__ && __SANITIZE_MEMORY__) int xtimegm(struct tm *tm, time_t *timep) { time_t time = timegm(tm); @@ -350,17 +351,3 @@ invalid: error: return -1; } - -int xgettime(struct timespec *result) { -#if _POSIX_TIMERS > 0 - return clock_gettime(CLOCK_REALTIME, result); -#else - struct timeval tv; - int ret = gettimeofday(&tv, NULL); - if (ret == 0) { - result->tv_sec = tv.tv_sec; - result->tv_nsec = tv.tv_usec * 1000L; - } - return ret; -#endif -} |