X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftime%2Ftime.c;h=166832d8a961d56b8ebcf9ebd4b58c62d1b1e4ed;hb=HEAD;hp=d0542f5654e86f06e69bc40c530ce0c989643e92;hpb=58c5a3524737ec1f6500dd766f717e2f158fc5c0;p=ccan diff --git a/ccan/time/time.c b/ccan/time/time.c index d0542f56..98107922 100644 --- a/ccan/time/time.c +++ b/ccan/time/time.c @@ -28,12 +28,12 @@ struct timeabs time_now(void) struct timemono time_mono(void) { struct timemono ret; -#ifdef TIME_HAVE_MONOTONIC +#if TIME_HAVE_MONOTONIC clock_gettime(CLOCK_MONOTONIC, &ret.ts); #else /* Best we can do */ ret.ts = time_now().ts; #endif /* !HAVE_TIME_MONOTONIC */ - return ret; + return TIMEMONO_CHECK(ret); } struct timerel time_divide(struct timerel t, unsigned long div) @@ -128,3 +128,11 @@ struct timeabs timeabs_check(struct timeabs t, const char *abortstr) ret.ts = time_check_(t.ts, abortstr); return ret; } + +struct timemono timemono_check(struct timemono t, const char *abortstr) +{ + struct timemono ret; + + ret.ts = time_check_(t.ts, abortstr); + return ret; +}