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


On Fri, May 18, 2012 at 9:55 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> Like this? ?I am trying to avoid touch all other wordsize.h files.
>
> Pretty much, yes.
>
>> ? ? ? * sysdeps/unix/sysv/linux/bits/statvfs.h (_STATVFSBUF_F_UNUSED):
>> ? ? ? Don't define if __SYSCALL_WORDSIZE is 64.
>
> Write "if [__SYSCALL_WORDSIZE != 32]" to be clear that it's an #if
> condition (the brackets), and to be precise about what the actual
> condition is.
>
>> -#if __WORDSIZE == 32
>> +#if __WORDSIZE == 32 && (!defined __SYSCALL_WORDSIZE ||
>> __SYSCALL_WORDSIZE == 32)
>
> [It looks like your patch got word-wrapped in pasting into the mail.]

Yes, line is too long.  I break it into 2 lines.

>> +#ifdef __x86_64__
>> +# define __SYSCALL_WORDSIZE ? ? ? ? ?64
>> +#endif
>
> Please give it a comment.
>

Here is the updated patch.  Does it look OK?

Thanks.

-- 
H.J.
---
	* sysdeps/unix/sysv/linux/bits/statvfs.h (_STATVFSBUF_F_UNUSED):
	Don't define if [__SYSCALL_WORDSIZE != 32].
	* sysdeps/x86_64/bits/wordsize.h (__SYSCALL_WORDSIZE):
	New macro.

diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h
b/sysdeps/unix/sysv/linux/bits/statvfs.h
index 4b3fc57..d835dff 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,8 @@

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

-#if __WORDSIZE == 32
+#if (__WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
 #define _STATVFSBUF_F_UNUSED
 #endif

diff --git a/sysdeps/x86_64/bits/wordsize.h b/sysdeps/x86_64/bits/wordsize.h
index 9b38756..e25af28 100644
--- a/sysdeps/x86_64/bits/wordsize.h
+++ b/sysdeps/x86_64/bits/wordsize.h
@@ -2,7 +2,11 @@

 #if defined __x86_64__ && !defined __ILP32__
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
+
+#ifdef __x86_64__
+/* Both x86-64 and x32 use the 64-bit system call interface.  */
+# define __SYSCALL_WORDSIZE		64
+#endif


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