1#ifdef HAVE_CONFIG_H 2#include "config.h" 3#endif /* HAVE_CONFIG_H */ 4 5#include <atalk/compat.h> 6 7#if !defined HAVE_DIRFD && defined SOLARIS 8#include <dirent.h> 9int dirfd(DIR *dir) 10{ 11 return dir->d_fd; 12} 13#endif 14 15#ifndef HAVE_STRNLEN 16size_t strnlen(const char *s, size_t max) 17{ 18 size_t len; 19 20 for (len = 0; len < max; len++) { 21 if (s[len] == '\0') { 22 break; 23 } 24 } 25 return len; 26} 27#endif 28