X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=regress%2Fhcommon.c.m4;fp=regress%2Fhcommon.c.m4;h=74811a73e32807f1284aaeb57857ee7b637ae0c5;hb=f5b6d7042f5e5f4b0df2cf96b60d9e47f5f03a50;hp=f3c77d9de1e55263d91e9d926dbd7ba0be4696e3;hpb=5d3224e9de99d596dc8d973a75266afc603a46cd;p=adns.git diff --git a/regress/hcommon.c.m4 b/regress/hcommon.c.m4 index f3c77d9..74811a7 100644 --- a/regress/hcommon.c.m4 +++ b/regress/hcommon.c.m4 @@ -36,6 +36,7 @@ m4_include(hmacros.i4) #include #include +#include #include "harness.h" #include "internal.h" @@ -75,6 +76,17 @@ int Hgettimeofday(struct timeval *tv, struct timezone *tz) { *tv= currenttime; return 0; } +int Hclock_gettime(clockid_t clk, struct timespec *ts) { + Tensuresetup(); + ts->tv_sec = currenttime.tv_sec; + ts->tv_nsec = currenttime.tv_usec * 1000 + 666; + switch (clk) { + case CLOCK_MONOTONIC: ts->tv_sec -= 1500000000; break; + case CLOCK_REALTIME: break; + default: Tmust("clock_gettime","clk",0); + } + return 0; +} int Hwritev(int fd, const struct iovec *vector, size_t count) { size_t i;