PATCH: Add x86-64 bits/utmp.h and bits/utmpx.h

H.J. Lu hjl.tools@gmail.com
Sat May 19 00:13:00 GMT 2012


On Fri, May 18, 2012 at 4:12 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>       * sysdeps/gnu/bits/utmp.h (lastlog): Check __WORDSIZE_TIME64_COMPAT32
>>       instead of __WORDSIZE and __WORDSIZE_COMPAT32.
>>       (utmp): Likewise.
>>       * sysdeps/gnu/bits/utmpx.h (utmpx): Likewise.
>
> (struct lastlog)
> (struct utmp)
> (struct utmpx)
>
> When mentioning #if stuff, write it like this:
>
> Check [__WORDSIZE_TIME64_COMPAT32] instead of
> [__WORDSIZE == 64 && __WORDSIZE_COMPAT32].
>
>>       * sysdeps/powerpc/powerpc32/bits/wordsize.h (__WORDSIZE_COMPAT32):
>>       Renamed to ...
>>       (__WORDSIZE_TIME64_COMPAT32): This.
>
> I didn't realize this was the only use of __WORDSIZE_COMPAT32.
> Since it is, I think this is fine.  But the maintainers for all
> the affected machines should have an opportunity to object.
>
>> +#ifdef __x86_64__
>> +# define __WORDSIZE_TIME64_COMPAT32          1
>> +# define __WORDSIZE_NO_STATVFSBUF_F_UNUSED   1
>> +#endif
>
> __WORDSIZE_NO_STATVFSBUF_F_UNUSED is unrelated to this change and does not
> belong in the same commit.
>
>

Here is the updated patch.  I will wait until next Monday for any objections.

Thanks.

-- 
H.J.
	* sysdeps/gnu/bits/utmp.h (struct lastlog): Check
	[__WORDSIZE_TIME64_COMPAT32] instead of
	[__WORDSIZE == 64 && __WORDSIZE_COMPAT32].
	(struct utmp): Likewise.
	* sysdeps/gnu/bits/utmpx.h (struct utmpx): Likewise.
	* sysdeps/powerpc/powerpc32/bits/wordsize.h (__WORDSIZE_COMPAT32):
	Renamed to ...
	(__WORDSIZE_TIME64_COMPAT32): This.
	* sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise.
	* sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
	* sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h: Likewise.
	* sysdeps/x86_64/bits/wordsize.h (__WORDSIZE_COMPAT32): Removed.
	(__WORDSIZE_TIME64_COMPAT32): New macro.

diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index c13380a..aed2750 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -1,6 +1,5 @@
 /* The `struct utmp' type, describing entries in the utmp file.  GNU version.
-   Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
-   Free Software Foundation, Inc.
+   Copyright (C) 1993-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
@@ -36,7 +35,7 @@
    previous logins.  */
 struct lastlog
   {
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
     int32_t ll_time;
 #else
     __time_t ll_time;
@@ -69,7 +68,7 @@ struct utmp
 /* The ut_session and ut_tv fields must be the same size when compiled
    32- and 64-bit.  This allows data files and shared memory to be
    shared between 32- and 64-bit applications.  */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
   int32_t ut_session;		/* Session ID, used for windowing.  */
   struct
   {
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index 87626f0..f8716ca 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -1,5 +1,5 @@
 /* Structures and definitions for the user accounting database.  GNU version.
-   Copyright (C) 1997, 1998, 2000, 2001, 2002 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
@@ -66,7 +66,7 @@ struct utmpx
 /* The fields ut_session and ut_tv must be the same size when compiled
    32- and 64-bit.  This allows files and shared memory to be shared
    between 32- and 64-bit applications.  */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
   __int32_t ut_session;		/* Session ID, used for windowing.  */
   struct
   {
diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h
b/sysdeps/powerpc/powerpc32/bits/wordsize.h
index 1a79c86..f31ac9a 100644
--- a/sysdeps/powerpc/powerpc32/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h
@@ -2,7 +2,7 @@

 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
+# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h
b/sysdeps/powerpc/powerpc64/bits/wordsize.h
index 1a79c86..f31ac9a 100644
--- a/sysdeps/powerpc/powerpc64/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h
@@ -2,7 +2,7 @@

 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
+# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h
b/sysdeps/sparc/sparc32/bits/wordsize.h
index 0dee88b..d8fd1a5 100644
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -2,7 +2,7 @@

 #if defined __arch64__ || defined __sparcv9
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
+# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h
b/sysdeps/sparc/sparc64/bits/wordsize.h
index 0dee88b..d8fd1a5 100644
--- a/sysdeps/sparc/sparc64/bits/wordsize.h
+++ b/sysdeps/sparc/sparc64/bits/wordsize.h
@@ -2,7 +2,7 @@

 #if defined __arch64__ || defined __sparcv9
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
+# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index cf93423..3e8a1e0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -2,7 +2,7 @@

 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
+# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
diff --git a/sysdeps/x86_64/bits/wordsize.h b/sysdeps/x86_64/bits/wordsize.h
index 9b38756..48dda22 100644
--- a/sysdeps/x86_64/bits/wordsize.h
+++ b/sysdeps/x86_64/bits/wordsize.h
@@ -2,7 +2,10 @@

 #if defined __x86_64__ && !defined __ILP32__
 # define __WORDSIZE	64
-# define __WORDSIZE_COMPAT32	1
 #else
 # define __WORDSIZE	32
 #endif
+
+#ifdef __x86_64__
+# define __WORDSIZE_TIME64_COMPAT32	1
+#endif



More information about the Libc-alpha mailing list