From: Austin English Subject: ntdll: wrap getdirentries around getdents on NetBSD Message-Id: Date: Mon, 7 Sep 2015 02:40:07 -0500 For https://bugs.winehq.org/show_bug.cgi?id=18166 -- -Austin commit cc5b803738dd01d528552597c8b231ea8e08021e Author: Austin English Date: Mon Sep 7 00:39:22 2015 -0700 ntdll: wrap getdirentries around getdents on NetBSD diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 0e02f2e..99d0fb8 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -131,6 +131,16 @@ static inline int getdents64( int fd, char *de, unsigned int size ) #endif /* linux */ +#if defined (__NetBSD__) /* getdirentries is broken on NetBSD */ + +int getdirentries_netbsd(int fd, char *buf, int nbytes, long *basep) +{ + *basep = (long)lseek(fd, 0, SEEK_CUR); + return getdents(fd, buf, (size_t)nbytes); +} +#define getdirentries getdirentries_netbsd +#endif + #define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') #define IS_SEPARATOR(ch) ((ch) == '\\' || (ch) == '/')