void-packages/srcpkgs/plan9port/patches/musl_getdents.patch

23 lines
576 B
Diff

diff --git src/lib9/dirread.c src/lib9/dirread.c
index 40fbe3c7..9e77eac8 100644
--- src/lib9/dirread.c
+++ src/lib9/dirread.c
@@ -10,6 +10,7 @@ extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*);
static int
mygetdents(int fd, struct dirent *buf, int n)
{
+#if defined(__GLIBC__)
off_t off;
int nn;
@@ -17,6 +18,9 @@ mygetdents(int fd, struct dirent *buf, int n)
off = p9seek(fd, 0, 1);
nn = getdirentries(fd, (void*)buf, n, &off);
return nn;
+#else
+ return getdents(fd, (void*)buf, n);
+#endif
}
#elif defined(__APPLE__)
static int