diff --git a/src/modules/files/configure.in b/src/modules/files/configure.in
index f78a615dd0fa272fcc1e3c550bb476638af875af..44ecb6a4b6ccd4c23934dd5a1883a59313635901 100644
--- a/src/modules/files/configure.in
+++ b/src/modules/files/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.56 1998/07/23 22:03:56 grubba Exp $
+# $Id: configure.in,v 1.57 1998/08/06 22:47:55 grubba Exp $
 AC_INIT(file.c)
 AC_CONFIG_HEADER(file_machine.h)
 
@@ -7,13 +7,43 @@ sinclude(../module_configure.in)
 AC_HAVE_HEADERS(sys/types.h arpa/inet.h sys/socketvar.h netinet/in.h \
  sys/mount.h ustat.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
  sys/socket.h sys/stream.h sys/protosw.h netdb.h sys/sysproto.h winsock.h \
- direct.h sys/wait.h process.h sys/file.h net/netdb.h limits.h)
+ direct.h sys/wait.h process.h sys/file.h net/netdb.h limits.h unistd.h)
 AC_HEADER_DIRENT
 AC_CHECK_LIB(bind, __inet_ntoa)
 AC_CHECK_LIB(socket, socket)
 
 AC_HAVE_FUNCS(getwd perror readdir_r statvfs statfs ustat lseek64 lstat socketpair)
 
+AC_MSG_CHECKING(if the last argument to accept is a size_t)
+AC_CACHE_VAL(pike_cv_type_accept, [
+  AC_TRY_COMPILE([
+#ifndef _LARGEFILE_SOURCE
+#  define _FILE_OFFSET_BITS 64
+#  define _LARGEFILE_SOURCE
+#  define _LARGEFILE64_SOURCE 1
+#endif
+/* HPUX needs these too... */
+#ifndef __STDC_EXT__
+#  define __STDC_EXT__
+#endif /* !__STDC_EXT__ */
+
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+/* Here's the actual test: */
+int accept(int, struct sockaddr *, size_t *);
+  ], [
+    /* EMPTY */
+  ], pike_cv_type_accept=size_t, pike_cv_type_accept=int)
+])
+AC_MSG_RESULT($pike_cv_type_accept)
+AC_DEFINE_UNQUOTED(PIKE_ACCEPT_TYPE, $pike_cv_type_accept)
+
 AC_MSG_CHECKING(if mkdir takes 1 or 2 arguments)
 AC_CACHE_VAL(pike_cv_func_mkdir_args,[
 AC_TRY_COMPILE([
@@ -28,7 +58,9 @@ AC_TRY_COMPILE([
 #endif /* !__STDC_EXT__ */
 
 #include <sys/types.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #ifdef HAVE_DIRECT_H
 #include <direct.h>
 #endif
@@ -606,7 +638,9 @@ AC_TRY_RUN([
 #include <sys/wait.h>
 #include <netinet/in.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <sys/time.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
@@ -816,7 +850,9 @@ AC_TRY_RUN([
 #ifndef POSIX_SOURCE
 #define POSIX_SOURCE
 #endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <signal.h>
 
 int sig_child(int arg)