]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
getdents64 fallback d_type support
authorJoseph Myers <joseph@codesourcery.com>
Tue, 21 Sep 2010 21:02:08 +0000 (14:02 -0700)
committerAndreas Schwab <schwab@redhat.com>
Wed, 1 Dec 2010 14:35:12 +0000 (15:35 +0100)
(cherry picked from commit 1ac7a2c7b448c851eb8976fcc290a906a4075203)

ChangeLog
sysdeps/unix/sysv/linux/getdents.c

index 9dcf49d25365d080089419e04209e93d67743352..a929f59f150b4704bfd135d582c857f034131cd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-15  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
+       implementing getdents64 using getdents syscall, set d_type if
+       __ASSUME_GETDENTS32_D_TYPE.
+
 2010-09-14  Andreas Schwab  <schwab@redhat.com>
 
        * sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
index b33d1789adff11a04cbb1f6f5616bc8eed59418f..0aa918677dc6d81265aead6f1dbd4956248e7ac4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007
+/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -285,7 +285,11 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
        DIRENT_SET_DP_INO(dp, kdp->d_ino);
        dp->d_off = kdp->d_off;
        dp->d_reclen = new_reclen;
+#ifdef __ASSUME_GETDENTS32_D_TYPE
+       dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
+#else
        dp->d_type = DT_UNKNOWN;
+#endif
        memcpy (dp->d_name, kdp->d_name,
                kdp->d_reclen - offsetof (struct kernel_dirent, d_name));