patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch
changeset 1819 66fcfb3d6745
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch	Sun Feb 28 11:50:15 2010 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +From 13545bce877b33e30155fc412ad44cc118d83f77 Mon Sep 17 00:00:00 2001
     1.5 +From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
     1.6 +Date: Sat, 30 Jan 2010 00:24:37 +0900
     1.7 +Subject: [PATCH 15/15] getdents: Fix mips64 build
     1.8 +
     1.9 +On Wed, 27 Jan 2010 07:14:08 +0100, Carmelo AMOROSO <carmelo.amoroso@st.com> wrote:
    1.10 +> I would re-write your patch in a simpler way.
    1.11 +>
    1.12 +> We already have the following
    1.13 +>
    1.14 +> 136 #if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
    1.15 +> 137 attribute_hidden strong_alias(__getdents,__getdents64)
    1.16 +> 138 #endif
    1.17 +>
    1.18 +> I think that it's simpler to move in the proper place this statement.
    1.19 +
    1.20 +Thanks, indeed.  If we came into "#elif WORDSIZE == 32" block, above
    1.21 +condition never be true.  So we can just move this statement out of
    1.22 +"#if...#elif...#elif...#endif" block.  Here is a revised patch.
    1.23 +
    1.24 +------------------------------------------------------
    1.25 +From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
    1.26 +Subject: [PATCH] getdents: Fix mips64 build
    1.27 +
    1.28 +Some archs (such as mips64) do not have getdents64 syscall but have
    1.29 +getdents syscall.  Define alias for it.
    1.30 +
    1.31 +This fixes regression from 0.9.30.1.
    1.32 +
    1.33 +Backgrounds:
    1.34 +This is once done by commit e8b1c674.  But after the commit 33bcf733
    1.35 +("Use getdents syscall if kernel provide supports for this instead of
    1.36 +relying upon getdents64."), if __ASSUME_GETDENTS32_D_TYPE was defined
    1.37 +the alias for getdents64 is not defined.  The macro
    1.38 +__ASSUME_GETDENTS32_D_TYPE had been effectively ignored until 0.9.30.1
    1.39 +but the commit 0f0f20ab ("Move kernel-features.h header from the
    1.40 +linuxthread directory to a common one...") really enables it.
    1.41 +
    1.42 +Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
    1.43 +Signed-off-by: Khem Raj <raj.khem@gmail.com>
    1.44 +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
    1.45 +---
    1.46 + libc/sysdeps/linux/common/getdents.c |    8 ++++----
    1.47 + 1 files changed, 4 insertions(+), 4 deletions(-)
    1.48 +
    1.49 +diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c
    1.50 +index b518cc0..66a03b3 100644
    1.51 +--- a/libc/sysdeps/linux/common/getdents.c
    1.52 ++++ b/libc/sysdeps/linux/common/getdents.c
    1.53 +@@ -136,10 +136,6 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
    1.54 +     return (char *) dp - buf;
    1.55 + }
    1.56 + 
    1.57 +-#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
    1.58 +-attribute_hidden strong_alias(__getdents,__getdents64)
    1.59 +-#endif
    1.60 +-
    1.61 + #elif __WORDSIZE == 32
    1.62 + 
    1.63 + /* Experimentally off - libc_hidden_proto(memmove) */
    1.64 +@@ -171,4 +167,8 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
    1.65 + }
    1.66 + #endif
    1.67 + 
    1.68 ++#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
    1.69 ++attribute_hidden strong_alias(__getdents,__getdents64)
    1.70 ++#endif
    1.71 ++
    1.72 + #endif
    1.73 +-- 
    1.74 +1.6.6.1
    1.75 +