X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=regress%2Fhcommon.c.m4;h=74811a73e32807f1284aaeb57857ee7b637ae0c5;hb=HEAD;hp=5e3b58734cdd5826c531bf0a18437235f1821412;hpb=e18d88ce9eeb95d68a8853ea935ac9dcfef7b933;p=adns.git diff --git a/regress/hcommon.c.m4 b/regress/hcommon.c.m4 index 5e3b587..3fd2a10 100644 --- a/regress/hcommon.c.m4 +++ b/regress/hcommon.c.m4 @@ -2,12 +2,8 @@ m4_dnl hcommon.c m4_dnl (part of complex test harness, not of the library) m4_dnl - routines used for both record and playback -m4_dnl This file is part of adns, which is -m4_dnl Copyright (C) 1997-2000,2003,2006,2014-2016,2020 Ian Jackson -m4_dnl Copyright (C) 2014 Mark Wooding -m4_dnl Copyright (C) 1999-2000,2003,2006 Tony Finch -m4_dnl Copyright (C) 1991 Massachusetts Institute of Technology -m4_dnl (See the file INSTALL for full details.) +m4_dnl This file is part of adns, which is Copyright Ian Jackson +m4_dnl and contributors (see the file INSTALL for full details). m4_dnl m4_dnl This program is free software; you can redistribute it and/or modify m4_dnl it under the terms of the GNU General Public License as published by @@ -36,6 +32,7 @@ m4_include(hmacros.i4) #include #include +#include #include "harness.h" #include "internal.h" @@ -75,6 +72,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; @@ -256,6 +264,7 @@ void Toutputerr(void) { } void Hexit(int rv) { + Tensuresetup(); vb.used= 0; Tvbf("exit %d", rv); Q_vb();