public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* Improve MIPS n64 handling of 64-bit fcntl
@ 2012-07-31 23:23 Joseph S. Myers
  0 siblings, 0 replies; only message in thread
From: Joseph S. Myers @ 2012-07-31 23:23 UTC (permalink / raw)
  To: libc-ports

MIPS #includes the sysdeps/unix/sysv/linux/i386 version of fcntl.c and 
lockf64.c.  This is fine for o32 and n32, which do have a separate fcntl64 
syscall, but suboptimal for n64, where the fcntl syscall is 64-bit and the 
relevant structures have the same layout with and without 
_FILE_OFFSET_BITS=64.  I've applied this patch to make only o32 and n32 
use these files.  This makes n64 fall back to the default implementations 
(syscalls.list for fcntl, sysdeps/wordsize-64 for lockf64) which are the 
best ones to use for it.

(This is preparatory to removing __ASSUME_FCNTL64; those 
sysdeps/unix/sysv/linux/i386 files are the only places __ASSUME_FCNTL64 is 
used, and it turns out MIPS n64 is the only case where those files might 
have been used without the fcntl64 syscall being available.)

diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index a1b6dc5..4e45ae7 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,12 @@
+2012-07-31  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/fcntl.c: Remove.
+	* sysdeps/unix/sysv/linux/mips/lockf64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips32/fcntl.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/lockf64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c: Likewise.
+
 2012-07-27  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (mmap): New.
diff --git a/ports/sysdeps/unix/sysv/linux/mips/fcntl.c b/ports/sysdeps/unix/sysv/linux/mips/fcntl.c
deleted file mode 100644
index ea951bc..0000000
--- a/ports/sysdeps/unix/sysv/linux/mips/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/ports/sysdeps/unix/sysv/linux/mips/lockf64.c b/ports/sysdeps/unix/sysv/linux/mips/lockf64.c
deleted file mode 100644
index a88f5a7..0000000
--- a/ports/sysdeps/unix/sysv/linux/mips/lockf64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/lockf64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c
new file mode 100644
index 0000000..ea951bc
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c
new file mode 100644
index 0000000..a88f5a7
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/lockf64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c
new file mode 100644
index 0000000..ea951bc
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c
new file mode 100644
index 0000000..a88f5a7
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/lockf64.c>

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-31 23:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 23:23 Improve MIPS n64 handling of 64-bit fcntl Joseph S. Myers

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