This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add x86-64 x86_64/bits/statvfs.h


In Wed, May 16, 2012 at 1:08 PM, Roland McGrath <roland@hack.frob.com> wrote:
> I wonder how many of these wouldn't need all the duplication if we just
> added a bits/wordsize.h macro like __KERNEL_WORDSIZE that linux/bits/*.h
> files could test.

__KERNEL_WORDSIZE may be confusing since you can run
ia32 binaries under x86-64 kernel.  Here is a patch to add
__WORDSIZE_NO_STATVFSBUF_F_UNUSED.  OK to install,
pending on the __WORDSIZE_TIME64_COMPAT32 patch?

Thanks.

-- 
H.J.
----
	* sysdeps/unix/sysv/linux/bits/statvfs.h (_STATVFSBUF_F_UNUSED):
	Don't define if __WORDSIZE_NO_STATVFSBUF_F_UNUSED is defined.
	* sysdeps/x86_64/bits/wordsize.h (__WORDSIZE_NO_STATVFSBUF_F_UNUSED):
	New macro.

diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h
b/sysdeps/unix/sysv/linux/bits/statvfs.h
index 4b3fc57..340b758 100644
--- a/sysdeps/unix/sysv/linux/bits/statvfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2001,2002,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
@@ -21,7 +21,7 @@

 #include <bits/types.h>  /* For __fsblkcnt_t and __fsfilcnt_t.  */

-#if __WORDSIZE == 32
+#if __WORDSIZE == 32 && !defined __WORDSIZE_NO_STATVFSBUF_F_UNUSED
 #define _STATVFSBUF_F_UNUSED
 #endif

diff --git a/sysdeps/x86_64/bits/wordsize.h b/sysdeps/x86_64/bits/wordsize.h
index c0ca075..48dda22 100644
--- a/sysdeps/x86_64/bits/wordsize.h
+++ b/sysdeps/x86_64/bits/wordsize.h
@@ -8,4 +8,5 @@

 #ifdef __x86_64__
 # define __WORDSIZE_TIME64_COMPAT32		1
+# define __WORDSIZE_NO_STATVFSBUF_F_UNUSED	1
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]