Porting fixes.

diff --git a/server/sock.c b/server/sock.c
index d528ab5..3a4e514 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -37,7 +37,9 @@
 #ifdef HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
+#endif
 #ifdef HAVE_SYS_FILIO_H
 # include <sys/filio.h>
 #endif