This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, roland/dirent64, created. glibc-2.16-ports-merge-118-g0bbf73a
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 2 Aug 2012 20:22:07 -0000
- Subject: GNU C Library master sources branch, roland/dirent64, created. glibc-2.16-ports-merge-118-g0bbf73a
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, roland/dirent64 has been created
at 0bbf73a634c4f9be4dcc5517ed138d258247c39c (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0bbf73a634c4f9be4dcc5517ed138d258247c39c
commit 0bbf73a634c4f9be4dcc5517ed138d258247c39c
Author: Roland McGrath <roland@hack.frob.com>
Date: Thu Aug 2 11:13:51 2012 -0700
Clean up {alphasort,scandir,scandirat}{,64} for struct dirent == struct dirent64.
diff --git a/ChangeLog b/ChangeLog
index 94dc926..8422185 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,35 @@
2012-08-02 Roland McGrath <roland@hack.frob.com>
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h:
+ [__s390x__] (__INO_T_MATCHES_INO64_T): New macro.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ [defined __arch64__ || defined __sparcv9]
+ (__INO_T_MATCHES_INO64_T): New macro.
+ * sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+ [__x86_64__] (__INO_T_MATCHES_INO64_T): New macro.
+ * bits/dirent.h (_DIRENT_MATCHES_DIRENT64): New macro.
+ * sysdeps/unix/sysv/linux/bits/dirent.h
+ [defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T]
+ (_DIRENT_MATCHES_DIRENT64): New macro.
+ * dirent/alphasort.c [_DIRENT_MATCHES_DIRENT64]:
+ Define alphasort64 as an alias.
+ * dirent/scandir.c [_DIRENT_MATCHES_DIRENT64]:
+ Define scandir64 as an alias.
+ * dirent/scandirat.c [_DIRENT_MATCHES_DIRENT64]:
+ Define scandirat64 as an alias.
+ * dirent/alphasort64.c (alphasort64):
+ Conditionalize on [!_DIRENT_MATCHES_DIRENT64].
+ * dirent/scandir64.c: Likewise.
+ * dirent/scandirat64.c: Likewise.
+ * sysdeps/wordsize-64/alphasort.c: File removed.
+ * sysdeps/wordsize-64/alphasort64.c: File removed.
+ * sysdeps/wordsize-64/scandir.c: File removed.
+ * sysdeps/wordsize-64/scandir64.c: File removed.
+ * sysdeps/wordsize-64/scandirat.c: File removed.
+ * sysdeps/wordsize-64/scandirat64.c: File removed.
+
+2012-08-02 Roland McGrath <roland@hack.frob.com>
+
* io/lockf.c [__OFF_T_MATCHES_OFF64_T]:
Define lockf64 as an alias.
* libio/fseeko.c [__OFF_T_MATCHES_OFF64_T]:
diff --git a/bits/dirent.h b/bits/dirent.h
index ac1928d..5b803c6 100644
--- a/bits/dirent.h
+++ b/bits/dirent.h
@@ -1,5 +1,5 @@
/* Directory entry structure `struct dirent'. Stub version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,3 +33,6 @@ struct dirent64
int d_fileno;
};
#endif
+
+/* Inform libc code that these two types are identical. */
+#define _DIRENT_MATCHES_DIRENT64 1
diff --git a/dirent/alphasort.c b/dirent/alphasort.c
index 5939322..d272cb1 100644
--- a/dirent/alphasort.c
+++ b/dirent/alphasort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,3 +23,7 @@ alphasort (const struct dirent **a, const struct dirent **b)
{
return strcoll ((*a)->d_name, (*b)->d_name);
}
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (alphasort, alphasort64)
+#endif
diff --git a/dirent/alphasort64.c b/dirent/alphasort64.c
index 4f5c1dd..a4d37ab 100644
--- a/dirent/alphasort64.c
+++ b/dirent/alphasort64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,13 @@
#include <dirent.h>
#include <string.h>
+/* alphasort.c defines alphasort64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
int
alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return strcoll ((*a)->d_name, (*b)->d_name);
}
+
+#endif
diff --git a/dirent/scandir.c b/dirent/scandir.c
index 8b0a87b..6dce54d 100644
--- a/dirent/scandir.c
+++ b/dirent/scandir.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of scandir64, because
+ the types don't match scandir and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define scandir64 __renamed_scandir64
+
#include <dirent.h>
+
+#undef scandir64
+
#include <fcntl.h>
#ifndef SCANDIR
@@ -35,3 +42,7 @@ SCANDIR (dir, namelist, select, cmp)
{
return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp);
}
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandir, scandir64)
+#endif
diff --git a/dirent/scandir64.c b/dirent/scandir64.c
index 78ac570..bba302f 100644
--- a/dirent/scandir64.c
+++ b/dirent/scandir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,8 +17,13 @@
#include <dirent.h>
+/* scandir.c defines scandir64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
#define SCANDIR scandir64
#define SCANDIRAT scandirat64
#define DIRENT_TYPE struct dirent64
#include <dirent/scandir.c>
+
+#endif
diff --git a/dirent/scandirat.c b/dirent/scandirat.c
index 13bd574..c2704ba 100644
--- a/dirent/scandirat.c
+++ b/dirent/scandirat.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of scandir64, because
+ the types don't match scandir and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define scandirat64 __renamed_scandirat64
+
#include <dirent.h>
+
+#undef scandirat64
+
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -141,3 +148,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
return c.cnt;
}
libc_hidden_def (SCANDIRAT)
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandirat, scandirat64)
+#endif
diff --git a/dirent/scandirat64.c b/dirent/scandirat64.c
index a816ee9..608ca33 100644
--- a/dirent/scandirat64.c
+++ b/dirent/scandirat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,9 +17,14 @@
#include <dirent.h>
+/* scandirat.c defines scandirat64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
#define SCANDIRAT scandirat64
#define READDIR __readdir64
#define DIRENT_TYPE struct dirent64
#define SKIP_SCANDIR_CANCEL 1
#include "scandirat.c"
+
+#endif
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 7abf947..69c6b88 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,5 +1,8 @@
2012-08-02 Roland McGrath <roland@hack.frob.com>
+ * sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+ (_DIRENT_MATCHES_DIRENT64): New macro.
+
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
(__OFF_T_MATCHES_OFF64_T): New macro.
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
index f146466..487ad15 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,4 +51,7 @@ struct dirent64
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE
+/* Inform libc code that these two types are effectively identical. */
+#define _DIRENT_MATCHES_DIRENT64 1
+
#endif /* bits/dirent.h */
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
index 5728618..779e0a1 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,3 +50,8 @@ struct dirent64
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE
+
+#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
+/* Inform libc code that these two types are effectively identical. */
+# define _DIRENT64_MATCHES_DIRENT 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index bf3d8b7..b630488 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -72,6 +72,9 @@
for all ABI purposes, even if possibly expressed as different base types
for C type-checking purposes. */
# define __OFF_T_MATCHES_OFF64_T 1
+
+/* Same for ino_t and ino64_t. */
+# define __INO_T_MATCHES_INO64_T 1
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index 7b1f191..e55d642 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -66,6 +66,9 @@
for all ABI purposes, even if possibly expressed as different base types
for C type-checking purposes. */
# define __OFF_T_MATCHES_OFF64_T 1
+
+/* Same for ino_t and ino64_t. */
+# define __INO_T_MATCHES_INO64_T 1
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index a477627..397e867 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -78,6 +78,9 @@
for all ABI purposes, even if possibly expressed as different base types
for C type-checking purposes. */
# define __OFF_T_MATCHES_OFF64_T 1
+
+/* Same for ino_t and ino64_t. */
+# define __INO_T_MATCHES_INO64_T 1
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/wordsize-64/alphasort.c b/sysdeps/wordsize-64/alphasort.c
deleted file mode 100644
index edc4101..0000000
--- a/sysdeps/wordsize-64/alphasort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define alphasort64 rename_alphasort64
-
-#include "../../dirent/alphasort.c"
-
-#undef alphasort64
-
-weak_alias (alphasort, alphasort64)
diff --git a/sysdeps/wordsize-64/alphasort64.c b/sysdeps/wordsize-64/alphasort64.c
deleted file mode 100644
index 0850913..0000000
--- a/sysdeps/wordsize-64/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in alphasort.c. */
diff --git a/sysdeps/wordsize-64/scandir.c b/sysdeps/wordsize-64/scandir.c
deleted file mode 100644
index 9af7e9b..0000000
--- a/sysdeps/wordsize-64/scandir.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandir64 scandir64_renamed
-
-#include "../../dirent/scandir.c"
-
-#undef scandir64
-weak_alias (scandir, scandir64)
diff --git a/sysdeps/wordsize-64/scandir64.c b/sysdeps/wordsize-64/scandir64.c
deleted file mode 100644
index 3c2c4a1..0000000
--- a/sysdeps/wordsize-64/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandir.c. */
diff --git a/sysdeps/wordsize-64/scandirat.c b/sysdeps/wordsize-64/scandirat.c
deleted file mode 100644
index 02b8fde..0000000
--- a/sysdeps/wordsize-64/scandirat.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandirat64 scandirat64_renamed
-
-#include "../../dirent/scandirat.c"
-
-#undef scandirat64
-weak_alias (scandirat, scandirat64)
diff --git a/sysdeps/wordsize-64/scandirat64.c b/sysdeps/wordsize-64/scandirat64.c
deleted file mode 100644
index fb93865..0000000
--- a/sysdeps/wordsize-64/scandirat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandirat.c. */
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources