9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

commit de27e3fba58c3dd467c29ea9a1aea6f9e65a5299
parent 5673fdd72fae4823ba67e2c216bbfd724bc9e01c
Author: Evan Gates <evan.gates@gmail.com>
Date:   Fri,  9 Sep 2016 12:36:57 -0700

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.

Diffstat:
Mlib9/dirread.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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