public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix preadv, pwritev and fallocate for -D_FILE_OFFSET_BITS=64
Date: Wed, 04 Nov 2009 21:59:00 -0000	[thread overview]
Message-ID: <20091104215904.GJ3047@sunsite.ms.mff.cuni.cz> (raw)

Hi!

As reported in http://bugzilla.redhat.com/533063 , preadv/pwritev prototypes
are wrong on 32-bit arches with -D_FILE_OFFSET_BITS=64 and as I've just
found, fallocate is wrong too.
The problem is that only off_t is remapped to the 64-bit type transparently,
__off_t is not.

Fixed thusly.

2009-11-04  Jakub Jelinek  <jakub@redhat.com>

	* misc/sys/uio.h (preadv, pwritev): Fix type of last argument
	when -D_FILE_OFFSET_BITS=64.

	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h (fallocate): Fix types
	of last two arguments when -D_FILE_OFFSET_BITS=64.
	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h (fallocate): Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h (fallocate): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h (fallocate): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (fallocate): Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (fallocate): Likewise.
	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h (fallocate): Likewise.

--- libc/misc/sys/uio.h.jj	2009-05-16 19:23:36.000000000 +0200
+++ libc/misc/sys/uio.h	2009-11-04 22:40:37.000000000 +0100
@@ -80,10 +80,10 @@ extern ssize_t pwritev (int __fd, __cons
 # else
 #  ifdef __REDIRECT
 extern ssize_t __REDIRECT (preadv, (int __fd, __const struct iovec *__iovec,
-				    int __count, __off_t __offset),
+				    int __count, __off64_t __offset),
 			   preadv64) __wur;
 extern ssize_t __REDIRECT (pwritev, (int __fd, __const struct iovec *__iovec,
-				     int __count, __off_t __offset),
+				     int __count, __off64_t __offset),
 			   pwritev64) __wur;
 #  else
 #   define preadv preadv64
--- libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h	2009-11-04 22:43:43.000000000 +0100
@@ -253,8 +253,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h	2009-11-04 22:43:54.000000000 +0100
@@ -259,8 +259,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h	2009-11-04 22:44:06.000000000 +0100
@@ -279,8 +279,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h	2009-11-04 22:44:23.000000000 +0100
@@ -259,8 +259,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h	2009-11-04 22:44:31.000000000 +0100
@@ -273,8 +273,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h	2009-11-04 22:44:38.000000000 +0100
@@ -278,8 +278,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64
--- libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h	2009-11-04 22:44:47.000000000 +0100
@@ -259,8 +259,8 @@ extern ssize_t tee (int __fdin, int __fd
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
 #  ifdef __REDIRECT
-extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
-				   __off_t __len),
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+				   __off64_t __len),
 		       fallocate64);
 #  else
 #   define fallocate fallocate64

	Jakub

                 reply	other threads:[~2009-11-04 21:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091104215904.GJ3047@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).