ntdll: wrap getdirentries around getdents on NetBSD
Austin English
austinenglish at gmail.com
Mon Sep 7 02:40:07 CDT 2015
For https://bugs.winehq.org/show_bug.cgi?id=18166
--
-Austin
-------------- next part --------------
commit cc5b803738dd01d528552597c8b231ea8e08021e
Author: Austin English <austinenglish at gmail.com>
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) == '/')
More information about the wine-patches
mailing list