chiark / gitweb /
Remove all m4 output files from the distributed source tree.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 19 Nov 2016 18:54:46 +0000 (18:54 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
INSTALL
regress/harness.h [deleted file]
regress/hcommon.c [deleted file]
regress/hplayback.c [deleted file]
regress/hrecord.c [deleted file]
regress/hredirect.h [deleted file]
regress/hsyscalls.h [deleted file]
settings.make.in

index 973a4806991b50d0f0b54a650773f6c8905ecd48..c0667fc03f8fd3a49a2c0f5a5adf4e7e01637ee4 100644 (file)
@@ -35,6 +35,12 @@ regress/*_playback
 regress/output-*.*
 regress/pipe.out
 regress/pipe.err
+regress/harness.h
+regress/hcommon.c
+regress/hplayback.c
+regress/hrecord.c
+regress/hredirect.h
+regress/hsyscalls.h
 src/Makefile
 src/config.h
 web
diff --git a/INSTALL b/INSTALL
index 587db77dcacebf824a10b797d691b51a57b92bf3..c360d8908778332ec75b26d9c2b106a0d5052a29 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -67,7 +67,8 @@ containing tsearch, such as the GNU C library.  It is best if tsearch
 uses an automatically-balancing tree algorithm, like the glibc version
 does.  Simple binary trees may perform badly.
 
-If you change the m4 input files in regress/ you may need GNU m4.
+You will need an m4 that supports: -P, -I, patsubst, ifelse, include,
+translit, and len.
 
 You will probably find that GNU Make is required.
 Please do not report this as a bug; install GNU Make instead.
diff --git a/regress/harness.h b/regress/harness.h
deleted file mode 100644 (file)
index 85a936b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef HARNESS_H_INCLUDED
-#define HARNESS_H_INCLUDED
-#include "internal.h"
-#include "hsyscalls.h"
-/* There is a Q function (Q for Question) for each such syscall;
- * it constructs a string representing the call, and calls Q_str
- * on it, or constructs it in vb and calls Q_vb;
- */
-void Qselect(  int max , const fd_set *rfds , const fd_set *wfds , const fd_set *efds , struct timeval *to     );
-#ifdef HAVE_POLL
-void Qpoll(    const struct pollfd *fds , int nfds , int timeout       );
-#endif
-void Qsocket(  int domain , int type   );
-void Qfcntl(   int fd , int cmd , long arg     );
-void Qconnect( int fd , const struct sockaddr *addr , int addrlen      );
-void Qbind(    int fd , const struct sockaddr *addr , int addrlen      );
-void Qlisten(  int fd , int backlog    );
-void Qclose(   int fd  );
-void Qsendto(  int fd , const void *msg , int msglen , const struct sockaddr *addr , int addrlen       );
-void Qrecvfrom(        int fd , int buflen , int addrlen       );
-void Qread(    int fd , size_t buflen  );
-void Qwrite(   int fd , const void *buf , size_t len   );
-void Q_vb(void);
-extern void Tshutdown(void);
-/* General help functions */
-void Tfailed(const char *why);
-void Toutputerr(void);
-void Tnomem(void);
-void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
-void Tensurerecordfile(void);
-void Tmust(const char *call, const char *arg, int cond);
-void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
-void Tvbvf(const char *fmt, va_list al);
-void Tvbfdset(int max, const fd_set *set);
-void Tvbpollfds(const struct pollfd *fds, int nfds);
-void Tvbaddr(const struct sockaddr *addr, int addrlen);
-void Tvbbytes(const void *buf, int len);
-void Tvberrno(int e);
-void Tvba(const char *str);
-/* Shared globals */
-extern vbuf vb;
-extern struct timeval currenttime;
-extern const struct Terrno { const char *n; int v; } Terrnos[];
-/* Special cases */
-void Texit(int rv) NONRETURNING;
-#endif
diff --git a/regress/hcommon.c b/regress/hcommon.c
deleted file mode 100644 (file)
index 0aa3ffb..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "harness.h"
-#include "internal.h"
-vbuf vb;
-FILE *Toutputfile= 0;
-struct timeval currenttime;
-const struct Terrno Terrnos[]= {
-  { "EBADF",                     EBADF                        },
-  { "EAGAIN",                    EAGAIN                       },
-  { "EINPROGRESS",               EINPROGRESS                  },
-  { "EINTR",                     EINTR                        },
-  { "EINVAL",                    EINVAL                       },
-  { "EMSGSIZE",                  EMSGSIZE                     },
-  { "ENOBUFS",                   ENOBUFS                      },
-  { "ENOENT",                    ENOENT                       },
-  { "ENOPROTOOPT",               ENOPROTOOPT                  },
-  { "ENOSPC",                    ENOSPC                       },
-  { "EWOULDBLOCK",               EWOULDBLOCK                  },
-  { "EHOSTUNREACH",              EHOSTUNREACH                 },
-  { "ECONNRESET",                ECONNRESET                   },
-  { "ECONNREFUSED",              ECONNREFUSED                 },
-  { "EPIPE",                     EPIPE                        },
-  { "ENOTSOCK",                  ENOTSOCK                     },
-  {  0,                          0                            }
-};
-static vbuf vbw;
-int Hgettimeofday(struct timeval *tv, struct timezone *tz) {
-  Tensurerecordfile();
-  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; i<count; i++, vector++) {
-    if (!adns__vbuf_append(&vbw,vector->iov_base,vector->iov_len)) Tnomem();
-  }
-  return Hwrite(fd,vbw.buf,vbw.used);
-}
-void Qselect(  int max , const fd_set *rfds , const fd_set *wfds , const fd_set *efds , struct timeval *to     ) {
- vb.used= 0;
- Tvba("select");
-       Tvbf(" max=%d",max); 
-       Tvbf(" rfds="); Tvbfdset(max,rfds); 
-       Tvbf(" wfds="); Tvbfdset(max,wfds); 
-       Tvbf(" efds="); Tvbfdset(max,efds); 
-  if (to) Tvbf(" to=%ld.%06ld",(long)to->tv_sec,(long)to->tv_usec);
-  else Tvba(" to=null"); 
-  Q_vb();
-}
-#ifdef HAVE_POLL
-void Qpoll(    const struct pollfd *fds , int nfds , int timeout       ) {
- vb.used= 0;
- Tvba("poll");
-        Tvbf(" fds="); Tvbpollfds(fds,nfds); 
-       Tvbf(" timeout=%d",timeout); 
-  Q_vb();
-}
-#endif
-void Qsocket(  int domain , int type   ) {
- vb.used= 0;
- Tvba("socket");
-  Tvbf(domain==AF_INET ? " domain=AF_INET" :
-         domain==AF_INET6 ? " domain=AF_INET6" :
-         " domain=AF_???"); 
-  Tvbf(type==SOCK_STREAM ? " type=SOCK_STREAM" : " type=SOCK_DGRAM"); 
-  Q_vb();
-}
-void Qfcntl(   int fd , int cmd , long arg     ) {
- vb.used= 0;
- Tvba("fcntl");
-       Tvbf(" fd=%d",fd); 
-  if (cmd == F_SETFL) {
-   Tvbf(" cmd=F_SETFL %s",arg & O_NONBLOCK ? "O_NONBLOCK|..." : "~O_NONBLOCK&...");
-  } else if (cmd == F_GETFL) {
-   Tvba(" cmd=F_GETFL");
-  } else {
-   Tmust("cmd","F_GETFL/F_SETFL",0);
-  } 
-  Q_vb();
-}
-void Qconnect( int fd , const struct sockaddr *addr , int addrlen      ) {
- vb.used= 0;
- Tvba("connect");
-       Tvbf(" fd=%d",fd); 
-       Tvba(" addr="); Tvbaddr(addr,addrlen); 
-  Q_vb();
-}
-void Qbind(    int fd , const struct sockaddr *addr , int addrlen      ) {
- vb.used= 0;
- Tvba("bind");
-       Tvbf(" fd=%d",fd); 
-       Tvba(" addr="); Tvbaddr(addr,addrlen); 
-  Q_vb();
-}
-void Qlisten(  int fd , int backlog    ) {
- vb.used= 0;
- Tvba("listen");
-       Tvbf(" fd=%d",fd); 
-       Tvbf(" backlog=%d",backlog); 
-  Q_vb();
-}
-void Qclose(   int fd  ) {
- vb.used= 0;
- Tvba("close");
-       Tvbf(" fd=%d",fd); 
-  Q_vb();
-}
-void Qsendto(  int fd , const void *msg , int msglen , const struct sockaddr *addr , int addrlen       ) {
- vb.used= 0;
- Tvba("sendto");
-       Tvbf(" fd=%d",fd); 
-       Tvba(" addr="); Tvbaddr(addr,addrlen); 
-       Tvbbytes(msg,msglen); 
-  Q_vb();
-}
-void Qrecvfrom(        int fd , int buflen , int addrlen       ) {
- vb.used= 0;
- Tvba("recvfrom");
-       Tvbf(" fd=%d",fd); 
-       Tvbf(" buflen=%lu",(unsigned long)buflen); 
-  Q_vb();
-}
-void Qread(    int fd , size_t buflen  ) {
- vb.used= 0;
- Tvba("read");
-       Tvbf(" fd=%d",fd); 
-       Tvbf(" buflen=%lu",(unsigned long)buflen); 
-  Q_vb();
-}
-void Qwrite(   int fd , const void *buf , size_t len   ) {
- vb.used= 0;
- Tvba("write");
-       Tvbf(" fd=%d",fd); 
-       Tvbbytes(buf,len); 
-  Q_vb();
-}
-void Tvbaddr(const struct sockaddr *addr, int len) {
-  char buf[ADNS_ADDR2TEXT_BUFLEN];
-  int err, port;
-  int sz= sizeof(buf);
-  err= adns_addr2text(addr, 0, buf,&sz, &port);
-  assert(!err);
-  Tvbf(strchr(buf, ':') ? "[%s]:%d" : "%s:%d", buf,port);
-}
-void Tvbbytes(const void *buf, int len) {
-  const byte *bp;
-  int i;
-  if (!len) { Tvba("\n     ."); return; }
-  for (i=0, bp=buf; i<len; i++, bp++) {
-    if (!(i&31)) Tvba("\n     ");
-    else if (!(i&3)) Tvba(" ");
-    Tvbf("%02x",*bp);
-  }
-  Tvba(".");
-}
-void Tvbfdset(int max, const fd_set *fds) {
-  int i;
-  const char *comma= "";
-  if (!fds) {
-    Tvba("null");
-    return;
-  }
-  Tvba("[");
-  for (i=0; i<max; i++) {
-    if (!FD_ISSET(i,fds)) continue;
-    Tvba(comma);
-    Tvbf("%d",i);
-    comma= ",";
-  }
-  Tvba("]");
-}
-static void Tvbpollevents(int events) {
-  const char *delim= "";
-  events &= (POLLIN|POLLOUT|POLLPRI);
-  if (!events) { Tvba("0"); return; }
-  if (events & POLLIN) { Tvba("POLLIN"); delim= "|"; }
-  if (events & POLLOUT) { Tvba(delim); Tvba("POLLOUT"); delim= "|"; }
-  if (events & POLLPRI) { Tvba(delim); Tvba("POLLPRI"); }
-}
-void Tvbpollfds(const struct pollfd *fds, int nfds) {
-  const char *comma= "";
-  Tvba("[");
-  while (nfds>0) {
-    Tvba(comma);
-    Tvbf("{fd=%d, events=",fds->fd);
-    Tvbpollevents(fds->events);
-    Tvba(", revents=");
-    Tvbpollevents(fds->revents);
-    Tvba("}");
-    comma= ", ";
-    nfds--; fds++;
-  }
-  Tvba("]");
-}
-void Tvberrno(int e) {
-  const struct Terrno *te;
-  for (te= Terrnos; te->n && te->v != e; te++);
-  assert(te->n);
-  Tvba(te->n);
-}
-void Tvba(const char *str) {
-  if (!adns__vbuf_appendstr(&vb,str)) Tnomem();
-}
-void Tvbvf(const char *fmt, va_list al) {
-  char buf[1000];
-  buf[sizeof(buf)-2]= '\t';
-  vsnprintf(buf,sizeof(buf),fmt,al);
-  assert(buf[sizeof(buf)-2] == '\t');
-  Tvba(buf);
-}
-void Tvbf(const char *fmt, ...) {
-  va_list al;
-  va_start(al,fmt);
-  Tvbvf(fmt,al);
-  va_end(al);
-}
-void Tmust(const char *call, const char *arg, int cond) {
-  if (cond) return;
-  fprintf(stderr,"adns test harness: case not handled: system call %s, arg %s",call,arg);
-  exit(-1);
-}
-void Tfailed(const char *why) {
-  fprintf(stderr,"adns test harness: failure: %s: %s\n",why,strerror(errno));
-  exit(-1);
-}
-void Tnomem(void) {
-  Tfailed("unable to malloc/realloc");
-}
-void Toutputerr(void) {
-  Tfailed("write error on test harness output");
-}
-struct malloced {
-  struct malloced *next, *back;
-  size_t sz;
-  unsigned long count;
-  struct { double d; long ul; void *p; void (*fp)(void); } data;
-};
-static unsigned long malloccount, mallocfailat;
-static struct { struct malloced *head, *tail; } mallocedlist;
-#define MALLOCHSZ ((char*)&mallocedlist.head->data - (char*)mallocedlist.head)
-void *Hmalloc(size_t sz) {
-  struct malloced *newnode;
-  const char *mfavar;
-  char *ep;
-  assert(sz);
-  newnode= malloc(MALLOCHSZ + sz);  if (!newnode) Tnomem();
-  LIST_LINK_TAIL(mallocedlist,newnode);
-  newnode->sz= sz;
-  newnode->count= ++malloccount;
-  if (!mallocfailat) {
-    mfavar= getenv("ADNS_REGRESS_MALLOCFAILAT");
-    if (mfavar) {
-      mallocfailat= strtoul(mfavar,&ep,10);
-      if (!mallocfailat || *ep) Tfailed("ADNS_REGRESS_MALLOCFAILAT bad value");
-    } else {
-      mallocfailat= ~0UL;
-    }
-  }
-  assert(newnode->count != mallocfailat);
-  memset(&newnode->data,0xc7,sz);
-  return &newnode->data;
-}
-void Hfree(void *ptr) {
-  struct malloced *oldnode;
-  if (!ptr) return;
-  oldnode= (void*)((char*)ptr - MALLOCHSZ);
-  LIST_UNLINK(mallocedlist,oldnode);
-  memset(&oldnode->data,0x38,oldnode->sz);
-  free(oldnode);
-}
-void *Hrealloc(void *op, size_t nsz) {
-  struct malloced *oldnode;
-  void *np;
-  size_t osz;
-  if (op) { oldnode= (void*)((char*)op - MALLOCHSZ); osz= oldnode->sz; } else { osz= 0; }
-  np= Hmalloc(nsz);
-  if (osz) memcpy(np,op, osz>nsz ? nsz : osz);
-  Hfree(op);
-  return np;
-}
-void Texit(int rv) {
-  struct malloced *loopnode;
-  Tshutdown();
-  adns__vbuf_free(&vb);
-  adns__vbuf_free(&vbw);
-  if (mallocedlist.head) {
-    fprintf(stderr,"adns test harness: memory leaked:");
-    for (loopnode=mallocedlist.head; loopnode; loopnode=loopnode->next)
-      fprintf(stderr," %lu",loopnode->count);
-    putc('\n',stderr);
-    if (ferror(stderr)) exit(-1);
-  }
-  exit(rv);
-}
-void Hexit(int rv) {
-  vb.used= 0;
-  Tvbf("exit %d", rv);
-  Q_vb();
-  Texit(0);
-}
-pid_t Hgetpid(void) {
-  return 2264; /* just some number */
-}
diff --git a/regress/hplayback.c b/regress/hplayback.c
deleted file mode 100644 (file)
index ed23542..0000000
+++ /dev/null
@@ -1,598 +0,0 @@
-#include <assert.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "harness.h"
-static FILE *Tinputfile, *Treportfile;
-static vbuf vb2;
-extern void Tshutdown(void) {
-  adns__vbuf_free(&vb2);
-}
-static void Tensurereportfile(void) {
-  const char *fdstr;
-  int fd;
-  if (Treportfile) return;
-  Treportfile= stderr;
-  fdstr= getenv("ADNS_TEST_REPORT_FD"); if (!fdstr) return;
-  fd= atoi(fdstr);
-  Treportfile= fdopen(fd,"a"); if (!Treportfile) Tfailed("fdopen ADNS_TEST_REPORT_FD");
-}
-static void Psyntax(const char *where) {
-  fprintf(stderr,"adns test harness: syntax error in test log input file: %s\n",where);
-  exit(-1);
-}
-static void Pcheckinput(void) {
-  if (ferror(Tinputfile)) Tfailed("read test log input file");
-  if (feof(Tinputfile)) Psyntax("eof at syscall reply");
-}
-void Tensurerecordfile(void) {
-  const char *fdstr;
-  int fd;
-  int chars;
-  unsigned long sec, usec;
-  if (Tinputfile) return;
-  Tinputfile= stdin;
-  fdstr= getenv("ADNS_TEST_IN_FD");
-  if (fdstr) {
-    fd= atoi(fdstr);
-    Tinputfile= fdopen(fd,"r"); if (!Tinputfile) Tfailed("fdopen ADNS_TEST_IN_FD");
-  }
-  setvbuf(Tinputfile,0,_IONBF,0);
-  if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
-  fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
-  chars= -1;
-  sscanf(vb2.buf," start %lu.%lu%n",&sec,&usec,&chars);
-  if (chars==-1) Psyntax("start time invalid");
-  currenttime.tv_sec= sec;
-  currenttime.tv_usec= usec;
-  if (vb2.buf[chars] != '\n') Psyntax("not newline after start time");
-}
-static void Parg(const char *argname) {
-  int l;
-  if (vb2.buf[vb2.used++] != ' ') Psyntax("not a space before argument");
-  l= strlen(argname);
-  if (memcmp(vb2.buf+vb2.used,argname,l)) Psyntax("argument name wrong");
-  vb2.used+= l;
-  if (vb2.buf[vb2.used++] != '=') Psyntax("not = after argument name");
-}
-static int Pstring_maybe(const char *string) {
-  int l;
-  l= strlen(string);
-  if (memcmp(vb2.buf+vb2.used,string,l)) return 0;
-  vb2.used+= l;
-  return 1;
-}
-static void Pstring(const char *string, const char *emsg) {
-  if (Pstring_maybe(string)) return;
-  Psyntax(emsg);
-}
-static int Perrno(const char *stuff) {
-  const struct Terrno *te;
-  int r;
-  char *ep;
-  for (te= Terrnos; te->n && strcmp(te->n,stuff); te++);
-  if (te->n) return te->v;
-  r= strtoul(stuff+2,&ep,10);
-  if (*ep) Psyntax("errno value not recognised, not numeric");
-  return r;
-}
-static void P_updatetime(void) {
-  int chars;
-  unsigned long sec, usec;
-  if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
-  fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
-  chars= -1;
-  sscanf(vb2.buf," +%lu.%lu%n",&sec,&usec,&chars);
-  if (chars==-1) Psyntax("update time invalid");
-  currenttime.tv_sec+= sec;
-  currenttime.tv_usec+= usec;
-  if (currenttime.tv_usec > 1000000) {
-    currenttime.tv_sec++;
-    currenttime.tv_usec -= 1000000;
-  }
-  if (vb2.buf[chars] != '\n') Psyntax("not newline after update time");
-}
-static void Pfdset(fd_set *set, int max) {
-  int r, c;
-  char *ep;
-  if (!set) {
-    Pstring("null","null fdset pointer");
-    return;
-  }
-  if (vb2.buf[vb2.used++] != '[') Psyntax("fd set start not [");
-  FD_ZERO(set);
-  if (vb2.buf[vb2.used] == ']') { vb2.used++; return; }
-  for (;;) {
-    r= strtoul(vb2.buf+vb2.used,&ep,10);
-    if (r>=max) Psyntax("fd set member > max");
-    if (ep == (char*)vb2.buf+vb2.used) Psyntax("empty entry in fd set");
-    FD_SET(r,set);
-    vb2.used= ep - (char*)vb2.buf;
-    c= vb2.buf[vb2.used++];
-    if (c == ']') break;
-    if (c != ',') Psyntax("fd set separator not ,");
-  }
-}
-#ifdef HAVE_POLL
-static int Ppollfdevents(void) {
-  int events;
-  if (Pstring_maybe("0")) return 0;
-  events= 0;
-  if (Pstring_maybe("POLLIN")) {
-    events |= POLLIN;
-    if (!Pstring_maybe("|")) return events;
-  }
-  if (Pstring_maybe("POLLOUT")) {
-    events |= POLLOUT;
-    if (!Pstring_maybe("|")) return events;
-  }
-  Pstring("POLLPRI","pollfdevents PRI?");
-  return events;
-}
-static void Ppollfds(struct pollfd *fds, int nfds) {
-  int i;
-  char *ep;
-  const char *comma= "";
-  if (vb2.buf[vb2.used++] != '[') Psyntax("pollfds start not [");
-  for (i=0; i<nfds; i++) {
-    Pstring("{fd=","{fd= in pollfds");
-    fds->fd= strtoul(vb2.buf+vb2.used,&ep,10);
-    vb2.used= ep - (char*)vb2.buf;    
-    Pstring(", events=",", events= in pollfds");
-    fds->events= Ppollfdevents();
-    Pstring(", revents=",", revents= in pollfds");
-    fds->revents= Ppollfdevents();
-    Pstring("}","} in pollfds");
-    Pstring(comma,"separator in pollfds");
-    comma= ", ";
-  }
-  if (vb2.buf[vb2.used++] != ']') Psyntax("pollfds end not ]");
-}
-#endif
-static void Paddr(struct sockaddr *addr, int *lenr) {
-  adns_rr_addr a;
-  char *p, *q, *ep;
-  int err;
-  unsigned long ul;
-  p= vb2.buf+vb2.used;
-  if (*p!='[') {
-    q= strchr(p,':');
-    if (!q) Psyntax("missing :");
-    *q++= 0;
-  } else {
-    p++;
-    q= strchr(p,']');
-    if (!q) Psyntax("missing ]");
-    *q++= 0;
-    if (*q!=':') Psyntax("expected : after ]");
-    q++;
-  }
-  ul= strtoul(q,&ep,10);
-  if (*ep && *ep != ' ') Psyntax("invalid port (bad syntax)");
-  if (ul >= 65536) Psyntax("port too large");
-  a.len= sizeof(a.addr);
-  err= adns_text2addr(p, (int)ul, 0, &a.addr.sa,&a.len);
-  if (err) Psyntax("invalid address");
-  assert(*lenr >= a.len);
-  memcpy(addr, &a.addr, a.len);
-  *lenr= a.len;
-  vb2.used= ep - (char*)vb2.buf;
-}
-static int Pbytes(byte *buf, int maxlen) {
-  static const char hexdigits[]= "0123456789abcdef";
-  int c, v, done;
-  const char *pf;
-  done= 0;
-  for (;;) {
-    c= getc(Tinputfile); Pcheckinput();
-    if (c=='\n' || c==' ' || c=='\t') continue;
-    if (c=='.') break;
-    pf= strchr(hexdigits,c); if (!pf) Psyntax("invalid first hex digit");
-    v= (pf-hexdigits)<<4;
-    c= getc(Tinputfile); Pcheckinput();
-    pf= strchr(hexdigits,c); if (!pf) Psyntax("invalid second hex digit");
-    v |= (pf-hexdigits);
-    if (maxlen<=0) Psyntax("buffer overflow in bytes");
-    *buf++= v;
-    maxlen--; done++;
-  }
-  for (;;) {
-    c= getc(Tinputfile); Pcheckinput();
-    if (c=='\n') return done;
-  }
-}
-void Q_vb(void) {
-  const char *nl;
-  Tensurerecordfile();
-  if (!adns__vbuf_ensure(&vb2,vb.used+2)) Tnomem();
-  fread(vb2.buf,1,vb.used+2,Tinputfile);
-  if (feof(Tinputfile)) {
-    fprintf(stderr,"adns test harness: input ends prematurely; program did:\n %.*s\n",
-           vb.used,vb.buf);
-    exit(-1);
-  }
-  Pcheckinput();
-  if (vb2.buf[0] != ' ') Psyntax("not space before call");
-  if (memcmp(vb.buf,vb2.buf+1,vb.used) ||
-      vb2.buf[vb.used+1] != '\n') {
-    fprintf(stderr,
-            "adns test harness: program did unexpected:\n %.*s\n"
-            "was expecting:\n %.*s\n",
-            vb.used,vb.buf, vb.used,vb2.buf+1);
-    exit(1);
-  }
-  Tensurereportfile();
-  nl= memchr(vb.buf,'\n',vb.used);
-  fprintf(Treportfile," %.*s\n", (int)(nl ? nl - (const char*)vb.buf : vb.used), vb.buf);
-}
-int Hselect(   int max , fd_set *rfds , fd_set *wfds , fd_set *efds , struct timeval *to       ) {
- int r, amtread;
- char *ep;
- Qselect(      max , rfds , wfds , efds , to   );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," select=",8)) Psyntax("syscall reply mismatch");
- if (vb2.buf[8] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+8);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= strtoul(vb2.buf+8,&ep,10);
-  if (*ep && *ep!=' ') Psyntax("return value not E* or positive number");
-  vb2.used= ep - (char*)vb2.buf;
-       Parg("rfds"); Pfdset(rfds,max); 
-       Parg("wfds"); Pfdset(wfds,max); 
-       Parg("efds"); Pfdset(efds,max); 
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-#ifdef HAVE_POLL
-int Hpoll(     struct pollfd *fds , int nfds , int timeout     ) {
- int r, amtread;
- char *ep;
- Qpoll(        fds , nfds , timeout    );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," poll=",6)) Psyntax("syscall reply mismatch");
- if (vb2.buf[6] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+6);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= strtoul(vb2.buf+6,&ep,10);
-  if (*ep && *ep!=' ') Psyntax("return value not E* or positive number");
-  vb2.used= ep - (char*)vb2.buf;
-        Parg("fds"); Ppollfds(fds,nfds); 
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-#endif
-int Hsocket(   int domain , int type , int protocol    ) {
- int r, amtread;
- char *ep;
-  Tmust("socket","domain",domain==AF_INET || domain==AF_INET6); 
-  Tmust("socket","type",type==SOCK_STREAM || type==SOCK_DGRAM); 
- Qsocket(      domain , type   );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," socket=",8)) Psyntax("syscall reply mismatch");
- if (vb2.buf[8] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+8);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= strtoul(vb2.buf+8,&ep,10);
-  if (*ep && *ep!=' ') Psyntax("return value not E* or positive number");
-  vb2.used= ep - (char*)vb2.buf;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hfcntl(    int fd , int cmd , ...  ) {
- int r, amtread;
-       va_list al; long arg; 
-  Tmust("fcntl","cmd",cmd==F_SETFL || cmd==F_GETFL);
-  if (cmd == F_SETFL) {
-    va_start(al,cmd); arg= va_arg(al,long); va_end(al);
-  } else {
-    arg= 0;
-  } 
- Qfcntl(       fd , cmd , arg  );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," fcntl=",7)) Psyntax("syscall reply mismatch");
- if (vb2.buf[7] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+7);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= 0;
-  if (cmd == F_GETFL) {
-    if (!memcmp(vb2.buf+7,"O_NONBLOCK|...",14)) {
-      r= O_NONBLOCK;
-      vb2.used= 7+14;
-    } else if (!memcmp(vb2.buf+7,"~O_NONBLOCK&...",15)) {
-      vb2.used= 7+15;
-    } else {
-      Psyntax("fcntl flags not O_NONBLOCK|... or ~O_NONBLOCK&...");
-    }
-  } else if (cmd == F_SETFL) {
-  if (memcmp(vb2.buf+7,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 7+2;
-  r= 0;
-  } else {
-    Psyntax("fcntl not F_GETFL or F_SETFL");
-  }
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hconnect(  int fd , const struct sockaddr *addr , int addrlen      ) {
- int r, amtread;
- Qconnect(     fd , addr , addrlen     );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," connect=",9)) Psyntax("syscall reply mismatch");
- if (vb2.buf[9] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+9);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+9,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 9+2;
-  r= 0;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hbind(     int fd , const struct sockaddr *addr , int addrlen      ) {
- int r, amtread;
- Qbind(        fd , addr , addrlen     );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," bind=",6)) Psyntax("syscall reply mismatch");
- if (vb2.buf[6] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+6);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+6,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 6+2;
-  r= 0;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hlisten(   int fd , int backlog    ) {
- int r, amtread;
- Qlisten(      fd , backlog    );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," listen=",8)) Psyntax("syscall reply mismatch");
- if (vb2.buf[8] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+8);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+8,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 8+2;
-  r= 0;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hclose(    int fd  ) {
- int r, amtread;
- Qclose(       fd      );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," close=",7)) Psyntax("syscall reply mismatch");
- if (vb2.buf[7] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+7);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+7,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 7+2;
-  r= 0;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hsendto(   int fd , const void *msg , int msglen , unsigned int flags , const struct sockaddr *addr , int addrlen  ) {
- int r, amtread;
- char *ep;
-       Tmust("sendto","flags",flags==0); 
- Qsendto(      fd , msg , msglen , addr , addrlen      );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," sendto=",8)) Psyntax("syscall reply mismatch");
- if (vb2.buf[8] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+8);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= strtoul(vb2.buf+8,&ep,10);
-  if (*ep && *ep!=' ') Psyntax("return value not E* or positive number");
-  vb2.used= ep - (char*)vb2.buf;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
-int Hrecvfrom( int fd , void *buf , int buflen , unsigned int flags , struct sockaddr *addr , int *addrlen     ) {
- int r, amtread;
-       Tmust("recvfrom","flags",flags==0); 
-       Tmust("recvfrom","*addrlen",*addrlen>=sizeof(struct sockaddr_in)); 
- Qrecvfrom(    fd , buflen , *addrlen  );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," recvfrom=",10)) Psyntax("syscall reply mismatch");
- if (vb2.buf[10] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+10);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+10,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 10+2;
-  r= 0;
-       Parg("addr"); Paddr(addr,addrlen); 
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
-       r= Pbytes(buf,buflen); 
- P_updatetime();
- return r;
-}
-int Hread(     int fd , void *buf , size_t buflen      ) {
- int r, amtread;
- Qread(        fd , buflen     );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," read=",6)) Psyntax("syscall reply mismatch");
- if (vb2.buf[6] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+6);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  if (memcmp(vb2.buf+6,"OK",2)) Psyntax("success/fail not E* or OK");
-  vb2.used= 6+2;
-  r= 0;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
-       r= Pbytes(buf,buflen); 
- P_updatetime();
- return r;
-}
-int Hwrite(    int fd , const void *buf , size_t len   ) {
- int r, amtread;
- char *ep;
- Qwrite(       fd , buf , len  );
- if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
- fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
- Tensurereportfile();
- fprintf(Treportfile,"%s",vb2.buf);
- amtread= strlen(vb2.buf);
- if (amtread<=0 || vb2.buf[--amtread]!='\n')
-  Psyntax("badly formed line");
- vb2.buf[amtread]= 0;
- if (memcmp(vb2.buf," write=",7)) Psyntax("syscall reply mismatch");
- if (vb2.buf[7] == 'E') {
-  int e;
-  e= Perrno(vb2.buf+7);
-  P_updatetime();
-  errno= e;
-  return -1;
- }
-  r= strtoul(vb2.buf+7,&ep,10);
-  if (*ep && *ep!=' ') Psyntax("return value not E* or positive number");
-  vb2.used= ep - (char*)vb2.buf;
- assert(vb2.used <= amtread);
- if (vb2.used != amtread) Psyntax("junk at end of line");
- P_updatetime();
- return r;
-}
diff --git a/regress/hrecord.c b/regress/hrecord.c
deleted file mode 100644 (file)
index dec099b..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-#include <assert.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "harness.h"
-static FILE *Toutputfile;
-void Tshutdown(void) {
-}
-static void R_recordtime(void) {
-  int r;
-  struct timeval tv, tvrel;
-  Tensurerecordfile();
-  r= gettimeofday(&tv,0); if (r) Tfailed("gettimeofday syscallbegin");
-  tvrel.tv_sec= tv.tv_sec - currenttime.tv_sec;
-  tvrel.tv_usec= tv.tv_usec - currenttime.tv_usec;
-  if (tv.tv_usec < 0) { tvrel.tv_usec += 1000000; tvrel.tv_sec--; }
-  Tvbf("\n +%ld.%06ld",(long)tvrel.tv_sec,(long)tvrel.tv_usec);
-  currenttime= tv;
-}
-void Tensurerecordfile(void) {
-  const char *fdstr;
-  int fd, r;
-  if (Toutputfile) return;
-  Toutputfile= stdout;
-  fdstr= getenv("ADNS_TEST_OUT_FD");
-  if (fdstr) {
-    fd= atoi(fdstr);
-    Toutputfile= fdopen(fd,"a"); if (!Toutputfile) Tfailed("fdopen ADNS_TEST_OUT_FD");
-  }
-  r= gettimeofday(&currenttime,0); if (r) Tfailed("gettimeofday syscallbegin");
-  if (fprintf(Toutputfile," start %ld.%06ld\n",
-             (long)currenttime.tv_sec,(long)currenttime.tv_usec) == EOF) Toutputerr();
-}
-void Q_vb(void) {
-  if (!adns__vbuf_append(&vb,"",1)) Tnomem();
-  Tensurerecordfile();
-  if (fprintf(Toutputfile," %s\n",vb.buf) == EOF) Toutputerr();
-  if (fflush(Toutputfile)) Toutputerr();
-}
-static void R_vb(void) {
-  Q_vb();
-}
-int Hselect(   int max , fd_set *rfds , fd_set *wfds , fd_set *efds , struct timeval *to       ) {
- int r, e;
- Qselect(      max , rfds , wfds , efds , to   );
- r= select(    max , rfds , wfds , efds , to   );
- e= errno;
- vb.used= 0;
- Tvba("select=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tvbf("%d",r);
-       Tvba(" rfds="); Tvbfdset(max,rfds); 
-       Tvba(" wfds="); Tvbfdset(max,wfds); 
-       Tvba(" efds="); Tvbfdset(max,efds); 
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-#ifdef HAVE_POLL
-int Hpoll(     struct pollfd *fds , int nfds , int timeout     ) {
- int r, e;
- Qpoll(        fds , nfds , timeout    );
- r= poll(      fds , nfds , timeout    );
- e= errno;
- vb.used= 0;
- Tvba("poll=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tvbf("%d",r);
-        Tvba(" fds="); Tvbpollfds(fds,nfds); 
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-#endif
-int Hsocket(   int domain , int type , int protocol    ) {
- int r, e;
-  Tmust("socket","domain",domain==AF_INET || domain==AF_INET6); 
-  Tmust("socket","type",type==SOCK_STREAM || type==SOCK_DGRAM); 
- Qsocket(      domain , type   );
- r= socket(    domain , type , protocol        );
- e= errno;
- vb.used= 0;
- Tvba("socket=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tvbf("%d",r);
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hfcntl(    int fd , int cmd , ...  ) {
- int r, e;
-       va_list al; long arg; 
-  Tmust("fcntl","cmd",cmd==F_SETFL || cmd==F_GETFL);
-  if (cmd == F_SETFL) {
-    va_start(al,cmd); arg= va_arg(al,long); va_end(al);
-  } else {
-    arg= 0;
-  } 
- Qfcntl(       fd , cmd , arg  );
- r= fcntl(     fd , cmd , arg  );
- e= errno;
- vb.used= 0;
- Tvba("fcntl=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  if (cmd == F_GETFL) {
-    Tvbf(r & O_NONBLOCK ? "O_NONBLOCK|..." : "~O_NONBLOCK&...");
-  } else {
-    if (cmd == F_SETFL) {
-      Tmust("fcntl","return",!r);
-    } else {
-      Tmust("cmd","F_GETFL/F_SETFL",0);
-    }
-    Tvba("OK");
-  }
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hconnect(  int fd , const struct sockaddr *addr , int addrlen      ) {
- int r, e;
- Qconnect(     fd , addr , addrlen     );
- r= connect(   fd , addr , addrlen     );
- e= errno;
- vb.used= 0;
- Tvba("connect=");
-  if (r) { Tvberrno(e); goto x_error; }
-  Tvba("OK");
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hbind(     int fd , const struct sockaddr *addr , int addrlen      ) {
- int r, e;
- Qbind(        fd , addr , addrlen     );
- r= bind(      fd , addr , addrlen     );
- e= errno;
- vb.used= 0;
- Tvba("bind=");
-  if (r) { Tvberrno(e); goto x_error; }
-  Tvba("OK");
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hlisten(   int fd , int backlog    ) {
- int r, e;
- Qlisten(      fd , backlog    );
- r= listen(    fd , backlog    );
- e= errno;
- vb.used= 0;
- Tvba("listen=");
-  if (r) { Tvberrno(e); goto x_error; }
-  Tvba("OK");
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hclose(    int fd  ) {
- int r, e;
- Qclose(       fd      );
- r= close(     fd      );
- e= errno;
- vb.used= 0;
- Tvba("close=");
-  if (r) { Tvberrno(e); goto x_error; }
-  Tvba("OK");
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hsendto(   int fd , const void *msg , int msglen , unsigned int flags , const struct sockaddr *addr , int addrlen  ) {
- int r, e;
-       Tmust("sendto","flags",flags==0); 
- Qsendto(      fd , msg , msglen , addr , addrlen      );
- r= sendto(    fd , msg , msglen , flags , addr , addrlen      );
- e= errno;
- vb.used= 0;
- Tvba("sendto=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tvbf("%d",r);
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hrecvfrom( int fd , void *buf , int buflen , unsigned int flags , struct sockaddr *addr , int *addrlen     ) {
- int r, e;
-       Tmust("recvfrom","flags",flags==0); 
-       Tmust("recvfrom","*addrlen",*addrlen>=sizeof(struct sockaddr_in)); 
- Qrecvfrom(    fd , buflen , *addrlen  );
- r= recvfrom(  fd , buf , buflen , flags , addr , addrlen      );
- e= errno;
- vb.used= 0;
- Tvba("recvfrom=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tmust("recvfrom","return",r<=buflen);
-  Tvba("OK");
-       Tvba(" addr="); Tvbaddr(addr,*addrlen); 
-       Tvbbytes(buf,r); 
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hread(     int fd , void *buf , size_t buflen      ) {
- int r, e;
- Qread(        fd , buflen     );
- r= read(      fd , buf , buflen       );
- e= errno;
- vb.used= 0;
- Tvba("read=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tmust("read","return",r<=buflen);
-  Tvba("OK");
-       Tvbbytes(buf,r); 
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
-int Hwrite(    int fd , const void *buf , size_t len   ) {
- int r, e;
- Qwrite(       fd , buf , len  );
- r= write(     fd , buf , len  );
- e= errno;
- vb.used= 0;
- Tvba("write=");
-  if (r==-1) { Tvberrno(e); goto x_error; }
-  Tvbf("%d",r);
- x_error:
- R_recordtime();
- R_vb();
- errno= e;
- return r;
-}
diff --git a/regress/hredirect.h b/regress/hredirect.h
deleted file mode 100644 (file)
index 7bff129..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef HREDIRECT_H_INCLUDED
-#define HREDIRECT_H_INCLUDED
-#include "hsyscalls.h"
-#undef select
-#define select Hselect
-#ifdef HAVE_POLL
-#undef poll
-#define poll Hpoll
-#endif
-#undef socket
-#define socket Hsocket
-#undef fcntl
-#define fcntl Hfcntl
-#undef connect
-#define connect Hconnect
-#undef bind
-#define bind Hbind
-#undef listen
-#define listen Hlisten
-#undef close
-#define close Hclose
-#undef sendto
-#define sendto Hsendto
-#undef recvfrom
-#define recvfrom Hrecvfrom
-#undef read
-#define read Hread
-#undef write
-#define write Hwrite
-#undef writev
-#define writev Hwritev
-#undef gettimeofday
-#define gettimeofday Hgettimeofday
-#undef getpid
-#define getpid Hgetpid
-#undef malloc
-#define malloc Hmalloc
-#undef free
-#define free Hfree
-#undef realloc
-#define realloc Hrealloc
-#undef exit
-#define exit Hexit
-#endif
diff --git a/regress/hsyscalls.h b/regress/hsyscalls.h
deleted file mode 100644 (file)
index 6dc9edc..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef HSYSCALLS_H_INCLUDED
-#define HSYSCALLS_H_INCLUDED
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#ifdef HAVE_POLL
-#include <sys/poll.h>
-#endif
-int Hselect(   int max , fd_set *rfds , fd_set *wfds , fd_set *efds , struct timeval *to       );
-#ifdef HAVE_POLL
-int Hpoll(     struct pollfd *fds , int nfds , int timeout     );
-#endif
-int Hsocket(   int domain , int type , int protocol    );
-int Hfcntl(    int fd , int cmd , ...  );
-int Hconnect(  int fd , const struct sockaddr *addr , int addrlen      );
-int Hbind(     int fd , const struct sockaddr *addr , int addrlen      );
-int Hlisten(   int fd , int backlog    );
-int Hclose(    int fd  );
-int Hsendto(   int fd , const void *msg , int msglen , unsigned int flags , const struct sockaddr *addr , int addrlen  );
-int Hrecvfrom( int fd , void *buf , int buflen , unsigned int flags , struct sockaddr *addr , int *addrlen     );
-int Hread(     int fd , void *buf , size_t buflen      );
-int Hwrite(    int fd , const void *buf , size_t len   );
-int Hwritev(int fd, const struct iovec *vector, size_t count);
-int Hgettimeofday(struct timeval *tv, struct timezone *tz);
-pid_t Hgetpid(void);
-void* Hmalloc(size_t sz);
-void Hfree(void *ptr);
-void* Hrealloc(void *op, size_t nsz);
-void Hexit(int rv)NONRETURNING;
-#endif
index 64c406e15d842cc9382c04e404dff05fcee56647..e68899db5313ef36f632775b2fcaf4086c5c7b89 100644 (file)
@@ -26,7 +26,7 @@ include               ../common.make
 all:                   $(TARGETS)
 
 clean mostlyclean:
-               rm -f $(TARGETS)
+               rm -f $(TARGETS) $(AUTOCSRCS) $(AUTOCHDRS)
                rm -f *.o *.tmp* *.so *.so.* pipe.*
                rm -f output-*.err output-*.leftover
                rm -f output-*.out output-*.report
@@ -34,7 +34,6 @@ clean mostlyclean:
 distclean:             clean
                rm -f *~ ./#*# core *.orig *.rej Makefile config.h
 
-distprep:              $(AUTOCSRCS) $(AUTOCHDRS)
+distprep:
 
 maintainer-clean:      distclean
-               -rm -f $(AUTOCSRCS) $(AUTOCHDRS)