chiark / gitweb /
Compile without HAVE_POLL ?
[adns.git] / client / adnstest.c
index cbb896a2a5b5b39afe25162ddd1e353506e172b6..88875d2c43eabd767acce5e15b66cb33150313ee 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/poll.h>
+
+#include "adns.h"
+
+#include "config.h"
 
 #ifndef OUTPUTSTREAM
 # define OUTPUTSTREAM stdout
 #endif
 
-#include "adns.h"
+#ifndef HAVE_POLL
+#undef poll
+int poll(struct pollfd *ufds, int nfds, int timeout) {
+  fputs("poll(2) not supported on this system\n",stderr);
+  exit(3);
+}
+#define adns_beforepoll(a,b,c,d,e) 0
+#define adns_afterpoll(a,b,c,d) 0
+#endif
 
 static void failure_status(const char *what, adns_status st) {
   fprintf(stderr,"adns failure: %s: %s\n",what,adns_strerror(st));