public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64
  2019-10-22 16:04 [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
@ 2019-10-22 16:04 ` Alistair Francis
  2019-10-22 22:33   ` Joseph Myers
  2019-10-22 22:28 ` [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Joseph Myers
  1 sibling, 1 reply; 6+ messages in thread
From: Alistair Francis @ 2019-10-22 16:04 UTC (permalink / raw)
  To: libc-alpha; +Cc: alistair23, Alistair Francis

Add a new macro __STATFS_MATCHES_STATFS64 that specifies if fsblkcnt_t
matches fsblkcnt64_t and if fsfilcnt_t matches fsfilcnt64_t.

On a 32-bit platform with a 64-bit ino_t type (__STATFS_MATCHES_STATFS64
== 1) we want to update the statfs struct to remove the padding as it
isn't required. As we don't have the padding we also need to update the
overflow checker to not access the undefined members.
---
This change was tested by running user space tests for RV32 and RV64.

This patch doesn't use the new macro. The RV32 port uses the macro, this
is a preperation patch.

v5:
 - Add missing changed to :
   - sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
   - sysdeps/mach/hurd/bits/typesizes.h
v4:
 - Convert to 0/1 convention instead of defined/not
 - Move "|| defined __STATFS_MATCHES_STATFS64" in the __WORDSIZE == 64
v2:
 - Change to if defined instead of if == 1
 - Introduce __STATFS_MATCHES_STATFS64

 bits/typesizes.h                                       | 5 +++++
 sysdeps/mach/hurd/bits/typesizes.h                     | 6 ++++++
 sysdeps/unix/sysv/linux/alpha/bits/typesizes.h         | 3 +++
 sysdeps/unix/sysv/linux/generic/bits/statfs.h          | 2 +-
 sysdeps/unix/sysv/linux/generic/bits/typesizes.h       | 6 +++++-
 sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h | 4 ++++
 sysdeps/unix/sysv/linux/s390/bits/typesizes.h          | 5 +++++
 sysdeps/unix/sysv/linux/sparc/bits/typesizes.h         | 5 +++++
 sysdeps/unix/sysv/linux/x86/bits/typesizes.h           | 5 +++++
 9 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/bits/typesizes.h b/bits/typesizes.h
index 779945bf099..ae6eff5fc5f 100644
--- a/bits/typesizes.h
+++ b/bits/typesizes.h
@@ -72,8 +72,13 @@
 
 /* And for rlim_t and rlim64_t.  */
 # define __RLIM_T_MATCHES_RLIM64_T	1
+
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
+
+# define __STATFS_MATCHES_STATFS64  0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
index c30de12d1d4..e4c975ebd07 100644
--- a/sysdeps/mach/hurd/bits/typesizes.h
+++ b/sysdeps/mach/hurd/bits/typesizes.h
@@ -64,5 +64,11 @@
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		256
 
+/* Tell the libc code that fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and
+   fsfilcnt64_t are actually the same type for all ABI purposes, even
+   if possibly expressed as different base types for C type-checking
+   purposes.  */
+# define __STATFS_MATCHES_STATFS64  1
+
 
 #endif /* bits/typesizes.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
index 20231152e33..5eb96f9a1e7 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
@@ -69,6 +69,9 @@
 /* And for __rlim_t and __rlim64_t.  */
 #define __RLIM_T_MATCHES_RLIM64_T 1
 
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
 
diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
index c4069aba620..e622daf2240 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
@@ -34,7 +34,7 @@
 
 #if defined __USE_FILE_OFFSET64
 # define __field64(type, type64, name) type64 name
-#elif __WORDSIZE == 64
+#elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64
 # define __field64(type, type64, name) type name
 #elif __BYTE_ORDER == __LITTLE_ENDIAN
 # define __field64(type, type64, name) \
diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index 05e3cfee454..0c8c2e0c12a 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -73,10 +73,14 @@
 
 /* And for __rlim_t and __rlim64_t.  */
 # define __RLIM_T_MATCHES_RLIM64_T	1
+
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
-#endif
 
+# define __STATFS_MATCHES_STATFS64  0
+#endif
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
 
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index 66546b07ccd..f63dbfae899 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -51,6 +51,9 @@ static inline int stat_overflow (struct stat *buf)
 /* Note that f_files and f_ffree may validly be a sign-extended -1.  */
 static inline int statfs_overflow (struct statfs *buf)
 {
+#if __STATFS_MATCHES_STATFS64
+  return 0;
+#else
   if (buf->__f_blocks_pad == 0 && buf->__f_bfree_pad == 0
       && buf->__f_bavail_pad == 0
       && (buf->__f_files_pad == 0
@@ -61,4 +64,5 @@ static inline int statfs_overflow (struct statfs *buf)
 
   __set_errno (EOVERFLOW);
   return -1;
+#endif
 }
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index 94234f92427..38034e3ad40 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -78,8 +78,13 @@
 
 /* And for __rlim_t and __rlim64_t.  */
 # define __RLIM_T_MATCHES_RLIM64_T	1
+
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
+
+# define __STATFS_MATCHES_STATFS64  0
 #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 037f530d65b..c93f428017b 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -72,8 +72,13 @@
 
 /* And for __rlim_t and __rlim64_t.  */
 # define __RLIM_T_MATCHES_RLIM64_T	1
+
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
+
+# define __STATFS_MATCHES_STATFS64  0
 #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 012651b3ab5..168990f9dda 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -84,8 +84,13 @@
 
 /* And for __rlim_t and __rlim64_t.  */
 # define __RLIM_T_MATCHES_RLIM64_T	1
+
+/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
+# define __STATFS_MATCHES_STATFS64  1
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
+
+# define __STATFS_MATCHES_STATFS64  0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
-- 
2.23.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
@ 2019-10-22 16:04 Alistair Francis
  2019-10-22 16:04 ` [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64 Alistair Francis
  2019-10-22 22:28 ` [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Joseph Myers
  0 siblings, 2 replies; 6+ messages in thread
From: Alistair Francis @ 2019-10-22 16:04 UTC (permalink / raw)
  To: libc-alpha; +Cc: alistair23, Alistair Francis

On a 32-bit platform with a 64-bit ino_t type (__INO_T_MATCHES_INO64_T
defined) we want to update the stat struct to remove the padding as it
isn't required. As we don't have the padding we also need to update the
overflow checker to not access the undefined members.
---
This change was tested by running user space tests for RV32 and RV64.

v6:
 - Update Makefile to build assert
v4:
 - Move the assert to: sysdeps/unix/sysv/linux/generic/stat-check.c
 - Add a comment around the assert
v3:
 - Don't use brackets around the defined
v2:
 - Change to if defined instead of if == 1

 sysdeps/unix/sysv/linux/generic/Makefile      |  2 +-
 sysdeps/unix/sysv/linux/generic/bits/stat.h   |  5 +++-
 sysdeps/unix/sysv/linux/generic/stat-check.c  | 29 +++++++++++++++++++
 .../sysv/linux/generic/wordsize-32/overflow.h |  4 +++
 4 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/generic/stat-check.c

diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
index 7e27e797726..124f83a0abd 100644
--- a/sysdeps/unix/sysv/linux/generic/Makefile
+++ b/sysdeps/unix/sysv/linux/generic/Makefile
@@ -1,3 +1,3 @@
 ifeq ($(subdir),misc)
-sysdep_routines += epoll_create inotify_init
+sysdep_routines += epoll_create inotify_init stat-check
 endif
diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h
index 1565f3f8248..34c455ed786 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h
@@ -42,7 +42,10 @@
 
 #if defined __USE_FILE_OFFSET64
 # define __field64(type, type64, name) type64 name
-#elif __WORDSIZE == 64
+#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
+# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
+#  error "ino_t and off_t must both be the same type"
+# endif
 # define __field64(type, type64, name) type name
 #elif __BYTE_ORDER == __LITTLE_ENDIAN
 # define __field64(type, type64, name) \
diff --git a/sysdeps/unix/sysv/linux/generic/stat-check.c b/sysdeps/unix/sysv/linux/generic/stat-check.c
new file mode 100644
index 00000000000..302d2e8c28a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/generic/stat-check.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Alistair Francis <alistair.francis@wdc.com> 2019
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/stat.h>
+#include <bits/typesizes.h>
+
+/* This is due to the layout code in bits/stat.h and the overflow handling in
+   wordsize-32/overflow.h, requiring either all or none of the three types
+   concerned to have padding.  */
+
+#if defined __INO_T_MATCHES_INO64_T
+_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+                "__blkcnt_t and __blkcnt64_t must match");
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index 45efcd8fd34..66546b07ccd 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -36,12 +36,16 @@ static inline off_t lseek_overflow (loff_t res)
 
 static inline int stat_overflow (struct stat *buf)
 {
+#if defined __INO_T_MATCHES_INO64_T
+  return 0;
+#else
   if (buf->__st_ino_pad == 0 && buf->__st_size_pad == 0
       && buf->__st_blocks_pad == 0)
     return 0;
 
   __set_errno (EOVERFLOW);
   return -1;
+#endif
 }
 
 /* Note that f_files and f_ffree may validly be a sign-extended -1.  */
-- 
2.23.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
  2019-10-22 16:04 [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
  2019-10-22 16:04 ` [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64 Alistair Francis
@ 2019-10-22 22:28 ` Joseph Myers
  2019-10-22 22:40   ` Alistair Francis
  1 sibling, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2019-10-22 22:28 UTC (permalink / raw)
  To: Alistair Francis; +Cc: libc-alpha, alistair23

On Tue, 22 Oct 2019, Alistair Francis wrote:

> diff --git a/sysdeps/unix/sysv/linux/generic/stat-check.c b/sysdeps/unix/sysv/linux/generic/stat-check.c
> new file mode 100644
> index 00000000000..302d2e8c28a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/generic/stat-check.c
> @@ -0,0 +1,29 @@
> +/* Copyright (C) 2011-2019 Free Software Foundation, Inc.

The new file should have a descriptive comment on its first line, before 
the copyright notice.  Copyright dates should be 2019 only (there is no 
copyrightable content in this file copied from older source files).

> +   This file is part of the GNU C Library.
> +   Contributed by Alistair Francis <alistair.francis@wdc.com> 2019

No "Contributed by" lines in new source files.  Contributors should be 
thanked in contrib.texi (with contributions described at the logical level 
rather than listing specific source files).

The patch is OK with those fixes.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64
  2019-10-22 16:04 ` [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64 Alistair Francis
@ 2019-10-22 22:33   ` Joseph Myers
  2019-10-22 22:42     ` Alistair Francis
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2019-10-22 22:33 UTC (permalink / raw)
  To: Alistair Francis; +Cc: libc-alpha, alistair23

On Tue, 22 Oct 2019, Alistair Francis wrote:

> On a 32-bit platform with a 64-bit ino_t type (__STATFS_MATCHES_STATFS64
> == 1)

The commit message should not talk about ino_t; the types in this 
structure are nothing to do with ino_t, even if in fact it happens that 
they do match.

> diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
> index c30de12d1d4..e4c975ebd07 100644
> --- a/sysdeps/mach/hurd/bits/typesizes.h
> +++ b/sysdeps/mach/hurd/bits/typesizes.h
> @@ -64,5 +64,11 @@
>  /* Number of descriptors that can fit in an `fd_set'.  */
>  #define	__FD_SETSIZE		256
>  
> +/* Tell the libc code that fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and
> +   fsfilcnt64_t are actually the same type for all ABI purposes, even
> +   if possibly expressed as different base types for C type-checking
> +   purposes.  */
> +# define __STATFS_MATCHES_STATFS64  1

I don't believe that's accurate.  __FSBLKCNT_T_TYPE is __ULONGWORD_TYPE 
but __FSBLKCNT64_T_TYPE is __UQUAD_TYPE, for example (and the only 
existing Hurd port is 32-bit, so the types never match for Hurd at 
present, so an unconditional 0 would be OK for the definition there right 
now).

> diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> index 20231152e33..5eb96f9a1e7 100644
> --- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> +++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> @@ -69,6 +69,9 @@
>  /* And for __rlim_t and __rlim64_t.  */
>  #define __RLIM_T_MATCHES_RLIM64_T 1
>  
> +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
> +# define __STATFS_MATCHES_STATFS64  1

This is also inaccurate; alpha, despite being a 64-bit architecture, uses 
a 32-bit statfs by default.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
  2019-10-22 22:28 ` [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Joseph Myers
@ 2019-10-22 22:40   ` Alistair Francis
  0 siblings, 0 replies; 6+ messages in thread
From: Alistair Francis @ 2019-10-22 22:40 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Alistair Francis, GNU C Library, alistair23

On Tue, Oct 22, 2019 at 3:28 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Tue, 22 Oct 2019, Alistair Francis wrote:
>
> > diff --git a/sysdeps/unix/sysv/linux/generic/stat-check.c b/sysdeps/unix/sysv/linux/generic/stat-check.c
> > new file mode 100644
> > index 00000000000..302d2e8c28a
> > --- /dev/null
> > +++ b/sysdeps/unix/sysv/linux/generic/stat-check.c
> > @@ -0,0 +1,29 @@
> > +/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
>
> The new file should have a descriptive comment on its first line, before

I added:

"Static assert for __blkcnt64_t when __INO_T_MATCHES_INO64_T is defined."

> the copyright notice.  Copyright dates should be 2019 only (there is no
> copyrightable content in this file copied from older source files).

Fixed

>
> > +   This file is part of the GNU C Library.
> > +   Contributed by Alistair Francis <alistair.francis@wdc.com> 2019
>
> No "Contributed by" lines in new source files.  Contributors should be
> thanked in contrib.texi (with contributions described at the logical level
> rather than listing specific source files).

Removed.

>
> The patch is OK with those fixes.

Thanks Joseph.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64
  2019-10-22 22:33   ` Joseph Myers
@ 2019-10-22 22:42     ` Alistair Francis
  0 siblings, 0 replies; 6+ messages in thread
From: Alistair Francis @ 2019-10-22 22:42 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Alistair Francis, GNU C Library, alistair23

On Tue, Oct 22, 2019 at 3:33 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Tue, 22 Oct 2019, Alistair Francis wrote:
>
> > On a 32-bit platform with a 64-bit ino_t type (__STATFS_MATCHES_STATFS64
> > == 1)
>
> The commit message should not talk about ino_t; the types in this
> structure are nothing to do with ino_t, even if in fact it happens that
> they do match.

I have dropped that explanation.

>
> > diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
> > index c30de12d1d4..e4c975ebd07 100644
> > --- a/sysdeps/mach/hurd/bits/typesizes.h
> > +++ b/sysdeps/mach/hurd/bits/typesizes.h
> > @@ -64,5 +64,11 @@
> >  /* Number of descriptors that can fit in an `fd_set'.  */
> >  #define      __FD_SETSIZE            256
> >
> > +/* Tell the libc code that fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and
> > +   fsfilcnt64_t are actually the same type for all ABI purposes, even
> > +   if possibly expressed as different base types for C type-checking
> > +   purposes.  */
> > +# define __STATFS_MATCHES_STATFS64  1
>
> I don't believe that's accurate.  __FSBLKCNT_T_TYPE is __ULONGWORD_TYPE
> but __FSBLKCNT64_T_TYPE is __UQUAD_TYPE, for example (and the only
> existing Hurd port is 32-bit, so the types never match for Hurd at
> present, so an unconditional 0 would be OK for the definition there right
> now).

Ok, removed.

>
> > diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> > index 20231152e33..5eb96f9a1e7 100644
> > --- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> > +++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
> > @@ -69,6 +69,9 @@
> >  /* And for __rlim_t and __rlim64_t.  */
> >  #define __RLIM_T_MATCHES_RLIM64_T 1
> >
> > +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.  */
> > +# define __STATFS_MATCHES_STATFS64  1
>
> This is also inaccurate; alpha, despite being a 64-bit architecture, uses
> a 32-bit statfs by default.

Ok, removed.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-22 22:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 16:04 [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
2019-10-22 16:04 ` [PATCH v6 2/2] Define __STATFS_MATCHES_STATFS64 Alistair Francis
2019-10-22 22:33   ` Joseph Myers
2019-10-22 22:42     ` Alistair Francis
2019-10-22 22:28 ` [PATCH v6 1/2] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Joseph Myers
2019-10-22 22:40   ` Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).