commit de27e3fba58c3dd467c29ea9a1aea6f9e65a5299
Author:     Evan Gates <[email protected]>
AuthorDate: Fri Sep 9 12:36:57 2016 -0700
Commit:     Anselm R Garbe <[email protected]>
CommitDate: Mon Sep 12 14:29:38 2016 +0200

    check for _LARGEFILE64_SOURCE instead of __USE_LARGEFILE64
    
    glibc doesn't define getdents() and requires use of the raw syscall. As
    such lib9/dirread.c needed to decide whether to use SYS_getdents or
    SYS_getdents64 and was checking if __USE_LARGEFILE64 was defined in
    order to do so. musl does not define __USE_LARGEFILE64 so the wrong
    syscall was being used. musl does however define _LARGEFILE64_SOURCE,
    the macro that glibc checks in order to define __USE_LARGEFILE64.

diff --git a/lib9/dirread.c b/lib9/dirread.c
index f114195..6c494ab 100644
--- a/lib9/dirread.c
+++ b/lib9/dirread.c
@@ -6,7 +6,7 @@
 
 #if defined (__linux__)
 # include <sys/syscall.h>
-# if defined (__USE_LARGEFILE64)
+# if defined (_LARGEFILE64_SOURCE)
 #  define getdents SYS_getdents64
 # else
 #  define getdents SYS_getdents

Reply via email to