#include <afs/stds.h>
#include <sys/types.h>
#include <signal.h>
-#ifdef AFS_NT40_ENV
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+#ifdef AFS_NT40_ENV
+#include <winsock2.h>
#include <WINNT/afsevent.h>
-#else
+#endif
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#include <time.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <stdio.h>