chiark / gitweb /
finalise
[adns.git] / regress / hcommon.c
index cd3530914230cf182740d375cadf907ef4db8532..3466ec98025648f29faff2be6bace386885734a7 100644 (file)
@@ -1,6 +1,7 @@
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -28,10 +29,12 @@ const struct Terrno Terrnos[]= {
   { "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;
@@ -90,6 +93,20 @@ void Qconnect(       int fd , const struct sockaddr *addr , int addrlen      ) {
        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");