+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <atalk/compat.h>
+#if !defined HAVE_DIRFD && defined SOLARIS
+#include <dirent.h>
+int dirfd(DIR *dir)
+{
+ return dir->d_fd;
+}
+#endif
+
#ifndef HAVE_STRNLEN
size_t strnlen(const char *s, size_t max)
{