#include <config.h>
#endif
-/* -------------------
- * need pread() and pwrite()
- */
-#ifdef HAVE_PREAD
-
-#ifndef HAVE_PWRITE
-#undef HAVE_PREAD
-#endif
-
-#endif
-
-#ifdef HAVE_PWRITE
-#ifndef HAVE_PREAD
-#undef HAVE_PWRITE
-#endif
-#endif
-
-/*
- Still have to figure out which platforms really
- need _XOPEN_SOURCE defined for pread.
-*/
-#if defined(HAVE_PREAD) && !defined(SOLARIS) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(TRU64)
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-#endif
-
+#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-#undef __USE_MISC
-#define __USE_MISC
#include <unistd.h>
-#endif
-
-#include <sys/cdefs.h>
-
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
+
+ #ifdef USE_MMAPPED_HEADERS
#include <sys/mman.h>
-#ifdef HAVE_SYS_TIME_H
+ #endif
+
#include <sys/time.h>
-#endif
-#include <netatalk/endian.h>
-/* version info */
-#define AD_VERSION1 0x00010000
-#define SFM_VERSION AD_VERSION1
+#include <atalk/bstrlib.h>
+#include <atalk/locking.h>
+/* version info */
#define AD_VERSION2 0x00020000
-#define AD_VERSION2_OSX 0x00020001
-/*
- #define AD_VERSION1_ADS 0x00010002
-*/
-#define AD_VERSION1_SFM 0x00010003
+#define AD_VERSION_EA 0x00020002
+
+/* default */
#define AD_VERSION AD_VERSION2
/*
#include <errno.h>
#include <unistd.h>
#include <signal.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
-/* POSIX.1 sys/wait.h check */
#include <sys/types.h>
-#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#endif /* HAVE_SYS_WAIT_H */
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif /* ! WEXITSTATUS */
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif /* ! WIFEXITED */
-
#include <sys/time.h>
#include <atalk/logger.h>
#include <atalk/util.h>