$NetBSD$

--- socket.c.orig	2008-01-31 04:47:13.000000000 +0300
+++ socket.c	2008-05-30 01:57:59.000000000 +0400
@@ -45,6 +45,9 @@
 # ifdef SVR4
 #  include <unistd.h>
 # endif
+# ifdef __NetBSD__
+#  include <unistd.h>
+# endif
 # ifdef __OpenBSD__
 #  include <unistd.h>
 # endif
@@ -125,7 +128,7 @@
   struct in_addr inad;
   const char **argv;
   int i = 0;
-# ifndef linux
+# if !(defined(linux) || defined(__NetBSD__))
   if (UNBNDP(name)) {
     DEFER_INTS;
     SYSCALL(entry = gethostent(););
