[hackers] [9base] check for _LARGEFILE64_SOURCE instead of __USE_LARGEFILE64 || Evan Gates

From: <git_AT_suckless.org>
Date: Mon, 12 Sep 2016 14:29:54 +0200 (CEST)

commit de27e3fba58c3dd467c29ea9a1aea6f9e65a5299
Author: Evan Gates <evan.gates_AT_gmail.com>
AuthorDate: Fri Sep 9 12:36:57 2016 -0700
Commit: Anselm R Garbe <garbeam_AT_gmail.com>
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
_AT_@ -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
Received on Mon Sep 12 2016 - 14:29:54 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 12 2016 - 14:36:15 CEST