public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] open64: Force O_LARGEFILE on 32-bit architectures
@ 2021-12-26  7:20 Stafford Horne
  2021-12-28 19:43 ` Adhemerval Zanella
  0 siblings, 1 reply; 3+ messages in thread
From: Stafford Horne @ 2021-12-26  7:20 UTC (permalink / raw)
  To: GLIBC patches

When running tests on OpenRISC which has 32-bit wordsize but 64-bit
timesize it was found that O_LARGEFILE is not being set when calling
open64.  For 64-bit architectures the O_LARGEFILE flag is generally
implied by the kernel according to force_o_largefile.  However, for
32-bit architectures this is not done.

For this patch I add an extra condition to the EXTRA_OPEN_FLAGS ifdef
logic to allow setting O_LARGEFILE on 32-bit architectures.

Tested on the OpenRISC the build works and timezone/tst-tzset passes
which was failing before.  I would expect this also would fix arc.
---
 sysdeps/unix/sysv/linux/open64.c            | 3 +--
 sysdeps/unix/sysv/linux/open64_nocancel.c   | 2 +-
 sysdeps/unix/sysv/linux/openat64.c          | 2 +-
 sysdeps/unix/sysv/linux/openat64_nocancel.c | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index 0904696973..5ae5e98b57 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -23,8 +23,7 @@
 #include <sysdep-cancel.h>
 #include <shlib-compat.h>
 
-
-#ifdef __OFF_T_MATCHES_OFF64_T
+#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32)
 # define EXTRA_OPEN_FLAGS 0
 #else
 # define EXTRA_OPEN_FLAGS O_LARGEFILE
diff --git a/sysdeps/unix/sysv/linux/open64_nocancel.c b/sysdeps/unix/sysv/linux/open64_nocancel.c
index d7f35656a1..0fe41175ac 100644
--- a/sysdeps/unix/sysv/linux/open64_nocancel.c
+++ b/sysdeps/unix/sysv/linux/open64_nocancel.c
@@ -23,7 +23,7 @@
 
 #include <not-cancel.h>
 
-#ifdef __OFF_T_MATCHES_OFF64_T
+#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32)
 # define EXTRA_OPEN_FLAGS 0
 #else
 # define EXTRA_OPEN_FLAGS O_LARGEFILE
diff --git a/sysdeps/unix/sysv/linux/openat64.c b/sysdeps/unix/sysv/linux/openat64.c
index dc226567c1..1019fc13ac 100644
--- a/sysdeps/unix/sysv/linux/openat64.c
+++ b/sysdeps/unix/sysv/linux/openat64.c
@@ -21,7 +21,7 @@
 
 #include <sysdep-cancel.h>
 
-#ifdef __OFF_T_MATCHES_OFF64_T
+#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32)
 # define EXTRA_OPEN_FLAGS 0
 #else
 # define EXTRA_OPEN_FLAGS O_LARGEFILE
diff --git a/sysdeps/unix/sysv/linux/openat64_nocancel.c b/sysdeps/unix/sysv/linux/openat64_nocancel.c
index 51377aea45..324f719ea4 100644
--- a/sysdeps/unix/sysv/linux/openat64_nocancel.c
+++ b/sysdeps/unix/sysv/linux/openat64_nocancel.c
@@ -22,7 +22,7 @@
 #include <sysdep-cancel.h>
 #include <not-cancel.h>
 
-#ifdef __OFF_T_MATCHES_OFF64_T
+#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32)
 # define EXTRA_OPEN_FLAGS 0
 #else
 # define EXTRA_OPEN_FLAGS O_LARGEFILE
-- 
2.31.1


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

end of thread, other threads:[~2021-12-28 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-26  7:20 [PATCH] open64: Force O_LARGEFILE on 32-bit architectures Stafford Horne
2021-12-28 19:43 ` Adhemerval Zanella
2021-12-28 21:53   ` Stafford Horne

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).