#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <limits.h>
+#include <math.h>
#ifdef HAVE_MINGW
#include <w32api.h>
#include <netinet/if_ether.h>
#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+
+#ifdef STATUS
+#undef STATUS
+#endif
+
#ifdef HAVE_MINGW
#define SLASH "\\"
#else