diff -urN xinetd-2.3.14/Makefile.in xinetd-2.3.14-haiku/Makefile.in
--- xinetd-2.3.14/Makefile.in	2003-08-15 14:00:45.017039360 +0000
+++ xinetd-2.3.14-haiku/Makefile.in	2011-01-20 16:23:31.770965504 +0000
@@ -76,26 +76,26 @@
 install: build
 	for i in $(DAEMONDIR) $(BINDIR) $(MANDIR)/man5 $(MANDIR)/man8 ; do \
 	   test -d $$i || mkdir -p $$i ; done
-	$(INSTALL_CMD) -m 755 xinetd/xinetd $(DAEMONDIR)
-	$(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR)
-	$(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR)
-	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5
-	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8
-	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8
-	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8
-	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8
+	$(INSTALL_CMD) -m 755 xinetd/xinetd $(DESTDIR)$(DAEMONDIR)
+	$(INSTALL_CMD) -m 755 xinetd/itox $(DESTDIR)$(DAEMONDIR)
+	$(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DESTDIR)$(DAEMONDIR)
+	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
+	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
+	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(DESTDIR)$(MANDIR)/man8/xinetd.8
+	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(DESTDIR)$(MANDIR)/man8/itox.8
+	$(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(DESTDIR)$(MANDIR)/man8/xconv.pl.8
 	@echo "You must put your xinetd.conf in /etc/xinetd.conf"
 	@echo "There is a sample config file in xinetd/sample.conf and you can"
 	@echo "use xconv.pl to convert your old inetd.conf file to an xinetd format"
 
 uninstall:
-	rm -f $(DAEMONDIR)/xinetd
-	rm -f $(DAEMONDIR)/itox
-	rm -f $(DAEMONDIR)/xconv.pl
-	rm -f $(MANDIR)/man5/xinetd.conf.5
-	rm -f $(MANDIR)/man8/xinetd.log.8
-	rm -f $(MANDIR)/man8/xinetd.8
-	rm -f $(MANDIR)/man8/itox.8
+	rm -f $(DESTDIR)$(DAEMONDIR)/xinetd
+	rm -f $(DESTDIR)$(DAEMONDIR)/itox
+	rm -f $(DESTDIR)$(DAEMONDIR)/xconv.pl
+	rm -f $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
+	rm -f $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
+	rm -f $(DESTDIR)$(MANDIR)/man8/xinetd.8
+	rm -f $(DESTDIR)$(MANDIR)/man8/itox.8
  
 distclean: clean
 	rm -f config.cache config.log Makefile config.status xinetd/itox
diff -urN xinetd-2.3.14/configure.in xinetd-2.3.14-haiku/configure.in
--- xinetd-2.3.14/configure.in	2005-03-30 23:15:28.006815744 +0000
+++ xinetd-2.3.14-haiku/configure.in	2011-01-20 15:05:58.205783040 +0000
@@ -7,9 +7,9 @@
 AC_PROG_RANLIB
 
 AC_CHECK_LIB(compat, main)
-AC_SEARCH_LIBS(gethostbyname, nsl socket resolv)
-AC_SEARCH_LIBS(getnameinfo, nsl socket resolv)
-AC_SEARCH_LIBS(inet_ntop, nsl socket resolv)
+AC_SEARCH_LIBS(gethostbyname, nsl socket resolv network)
+AC_SEARCH_LIBS(getnameinfo, nsl socket resolv network)
+AC_SEARCH_LIBS(inet_ntop, nsl socket resolv network)
 AC_CHECK_FUNCS(getnameinfo inet_ntop)
 AC_CHECK_FUNCS(difftime, ,
    AC_CHECK_LIB(m, difftime))
@@ -27,8 +27,9 @@
       AC_CHECK_LIB(nsl, socket)))
 AC_CHECK_FUNC(inet_aton, ,
 	AC_CHECK_LIB(nsl, inet_aton, ,
+           AC_CHECK_LIB(network, inet_aton, ,
 		AC_CHECK_LIB(socket, inet_aton, ,
-			AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)]))))
+			AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)])))))
 AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV)])
 AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL)])
 AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST)])
diff -urN xinetd-2.3.14/libs/src/sio/sio.c xinetd-2.3.14-haiku/libs/src/sio/sio.c
--- xinetd-2.3.14/libs/src/sio/sio.c	2003-06-01 21:57:23.013369344 +0000
+++ xinetd-2.3.14-haiku/libs/src/sio/sio.c	2011-01-20 15:47:03.457441280 +0000
@@ -10,7 +10,7 @@
 #include <sys/types.h>
 #endif
 
-#ifdef _APPLE_
+#if defined _APPLE_ || defined __HAIKU__
 #undef HAVE_MMAP
 #endif
 
diff -urN xinetd-2.3.14/libs/src/sio/siosup.c xinetd-2.3.14-haiku/libs/src/sio/siosup.c
--- xinetd-2.3.14/libs/src/sio/siosup.c	2003-09-06 14:41:59.013893632 +0000
+++ xinetd-2.3.14-haiku/libs/src/sio/siosup.c	2011-01-20 15:06:05.893386752 +0000
@@ -13,7 +13,7 @@
 #include <unistd.h>
 #include <syslog.h>
 
-#ifdef _APPLE_
+#if defined _APPLE_ || defined __HAIKU__
 #undef HAVE_MMAP
 #endif
 
diff -urN xinetd-2.3.14/xinetd/child.c xinetd-2.3.14-haiku/xinetd/child.c
--- xinetd-2.3.14/xinetd/child.c	2004-12-23 21:46:02.018350080 +0000
+++ xinetd-2.3.14-haiku/xinetd/child.c	2011-01-20 16:01:02.000000000 +0000
@@ -313,7 +313,11 @@
    {
       set_credentials( scp ) ;
       if ( SC_SPECIFIED( scp, A_NICE ) )
+#ifndef __HAIKU__
          (void) nice( SC_NICE( scp ) ) ;
+#else
+         sleep( 1 );
+#endif /* HAIKU does not have nice() */
    }
 
    if ( svc_child_access_control(sp, cp) != OK )
diff -urN xinetd-2.3.14/xinetd/confparse.c xinetd-2.3.14-haiku/xinetd/confparse.c
--- xinetd-2.3.14/xinetd/confparse.c	2005-04-08 21:35:48.018612224 +0000
+++ xinetd-2.3.14-haiku/xinetd/confparse.c	2011-01-20 15:27:06.675282944 +0000
@@ -716,8 +716,8 @@
 	   }
    }
 
-/* #ifndef NO_RPC */
-#if defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H)
+/* #ifdef HAVE_RPC_RPC */
+#if ((defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H)) && !defined __HAIKU__ )
    if ( SC_IS_RPC( scp ) && !SC_IS_UNLISTED( scp ) )
    {
       struct rpcent *rep = (struct rpcent *)getrpcbyname( SC_NAME(scp) ) ;
diff -urN xinetd-2.3.14/xinetd/server.h xinetd-2.3.14-haiku/xinetd/server.h
--- xinetd-2.3.14/xinetd/server.h	2003-08-06 06:12:10.024641536 +0000
+++ xinetd-2.3.14-haiku/xinetd/server.h	2011-01-20 11:31:20.000000000 +0000
@@ -24,6 +24,9 @@
 typedef int pid_t ;
 #endif
 
+#ifndef FNDELAY
+#define FNDELAY O_NONBLOCK
+#endif
 
 /*
  * This struct describes running servers
diff -urN xinetd-2.3.14/xinetd/signals.h xinetd-2.3.14-haiku/xinetd/signals.h
--- xinetd-2.3.14/xinetd/signals.h	2003-02-19 17:29:28.025165824 +0000
+++ xinetd-2.3.14-haiku/xinetd/signals.h	2011-01-20 15:02:27.000000000 +0000
@@ -6,6 +6,10 @@
 #ifndef _X_SIGNALS
 #define _X_SIGNALS
 
+#ifndef SIGIOT
+#define SIGIOT SIGABRT
+#endif
+
 #include "defs.h"
 
 #if defined(NO_POSIX_SIGS)
diff -urN xinetd-2.3.14/xinetd/util.h xinetd-2.3.14-haiku/xinetd/util.h
--- xinetd-2.3.14/xinetd/util.h	2005-10-05 21:45:41.026214400 +0000
+++ xinetd-2.3.14-haiku/xinetd/util.h	2011-01-20 11:46:15.000000000 +0000
@@ -4,6 +4,10 @@
 #include "pset.h"
 #include "defs.h"
 
+#ifndef FNDELAY
+#define FNDELAY O_NONBLOCK
+#endif
+
 void out_of_memory(const char *func);
 const struct name_value *nv_find_value(const struct name_value nv_array[],const char *name);
 const struct name_value *nv_find_name(const struct name_value nv_array[],int value);
