X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/bb7ba6773439e5bf3dfcc2779783a09906176550..f44558a28cc5dc20b43a78752dc61bd724168b67:/regress/hcommon.c.m4 diff --git a/regress/hcommon.c.m4 b/regress/hcommon.c.m4 index 4c1af7c..4684eaf 100644 --- a/regress/hcommon.c.m4 +++ b/regress/hcommon.c.m4 @@ -2,7 +2,7 @@ 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 Copyright (C) 1997, 1998 Ian Jackson +m4_dnl This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson 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 @@ -33,6 +33,7 @@ m4_include(hmacros.i4) vbuf vb; FILE *Toutputfile= 0; +struct timeval currenttime; const struct Terrno Terrnos[]= { { "EAGAIN", EAGAIN }, @@ -48,8 +49,23 @@ const struct Terrno Terrnos[]= { { 0, 0 } }; +static vbuf vbw; +int Hgettimeofday(struct timeval *tv, struct timezone *tz) { + Tmust("gettimeofday","tz",!tz); + *tv= currenttime; + return 0; +} +int Hwritev(int fd, const struct iovec *vector, size_t count) { + size_t i; + + vbw.used= 0; + for (i=0; iiov_base,vector->iov_len)) Tnomem(); + } + return Hwrite(fd,vbw.buf,vbw.used); +} m4_define(`hm_syscall', ` hm_create_proto_q @@ -75,12 +91,16 @@ void Q$1(hm_args_massage($3,void)) { } else { Tvba(" $'`1=F_GETFL"); }') - m4_define(`hm_arg_addr_in', `Tvbaddr($'`1,$'`2);') - m4_define(`hm_arg_bytes_in', `Tvbbytes($'`2,$'`4);') + m4_define(`hm_arg_addr_in', `Tvba(" $'`1="); Tvbaddr($'`1,$'`2);') + m4_define(`hm_arg_bytes_in', `') m4_define(`hm_arg_bytes_out', `Tvbf(" $'`4=%lu",(unsigned long)$'`4);') m4_define(`hm_arg_addr_out', `Tvbf(" *$'`2=%d",$'`2);') $3 + hm_create_nothing + m4_define(`hm_arg_bytes_in', `Tvbbytes($'`2,$'`4);') + $3 + Q_vb(); } ') @@ -106,6 +126,7 @@ void Tvbbytes(const void *buf, int len) { else if (!(i&3)) Tvba(" "); Tvbf("%02x",*bp); } + Tvba("."); } void Tvbfdset(int max, const fd_set *fds) { @@ -169,8 +190,3 @@ void Tnomem(void) { void Toutputerr(void) { Tfailed("write error on test harness output"); } - -void Tensureoutputfile(void) { - /* fixme: allow sending it elsewhere */ - Toutputfile= stdout; -}