public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: linux-arch@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH] fixing sendfile on 64bit architectures
Date: Wed, 19 May 2004 11:49:40 +0200	[thread overview]
Message-ID: <20040519114940.6b92cf1a.ak@suse.de> (raw)



sys_sendfile has a hardcoded 2GB limit. 64bit architectures should probably
always use sys_sendfile64() in their native system tables, because
for them sizeof(off_t) == sizeof(loff_t).  This patch does
this. It seemed easier to just change the 64bit entry tables instead of 
fixing up all the emulation layers to do 2GB checks on their own.

I changed all 64bit architectures except for parisc64, which seemed to 
already have a sendfile64.

-Andi



diff -u linux/include/asm-x86_64/unistd.h-o linux/include/asm-x86_64/unistd.h
--- linux/include/asm-x86_64/unistd.h-o	2004-05-19 11:42:07.000000000 +0200
+++ linux/include/asm-x86_64/unistd.h	2004-05-19 11:42:15.000000000 +0200
@@ -98,7 +98,7 @@
 __SYSCALL(__NR_getpid, sys_getpid)
 
 #define __NR_sendfile                           40
-__SYSCALL(__NR_sendfile, sys_sendfile)
+__SYSCALL(__NR_sendfile, sys_sendfile64)
 #define __NR_socket                             41
 __SYSCALL(__NR_socket, sys_socket)
 #define __NR_connect                            42
diff -u linux/arch/sparc64/kernel/systbls.S-o linux/arch/sparc64/kernel/systbls.S
--- linux/arch/sparc64/kernel/systbls.S-o	2004-04-06 13:12:04.000000000 +0200
+++ linux/arch/sparc64/kernel/systbls.S	2004-05-19 11:45:58.000000000 +0200
@@ -88,7 +88,7 @@
 /*20*/	.word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
 /*25*/	.word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
 /*30*/	.word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
-	.word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile
+	.word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
 /*40*/	.word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall
 	.word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
 /*50*/	.word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
diff -u linux/arch/ia64/kernel/entry.S-o linux/arch/ia64/kernel/entry.S
--- linux/arch/ia64/kernel/entry.S-o	2004-05-19 11:33:01.000000000 +0200
+++ linux/arch/ia64/kernel/entry.S	2004-05-19 11:42:26.000000000 +0200
@@ -1437,7 +1437,7 @@
 	data8 sys_getcwd
 	data8 sys_capget			// 1185
 	data8 sys_capset
-	data8 sys_sendfile
+	data8 sys_sendfile64
 	data8 sys_ni_syscall		// sys_getpmsg (STREAMS)
 	data8 sys_ni_syscall		// sys_putpmsg (STREAMS)
 	data8 sys_socket			// 1190
diff -u linux/arch/alpha/kernel/systbls.S-o linux/arch/alpha/kernel/systbls.S
--- linux/arch/alpha/kernel/systbls.S-o	1970-01-01 01:12:51.000000000 +0100
+++ linux/arch/alpha/kernel/systbls.S	2004-05-19 11:43:52.000000000 +0200
@@ -389,7 +389,7 @@
 	.quad sys_getcwd
 	.quad sys_capget
 	.quad sys_capset
-	.quad sys_sendfile			/* 370 */
+	.quad sys_sendfile64			/* 370 */
 	.quad sys_setresgid
 	.quad sys_getresgid
 	.quad sys_ni_syscall			/* sys_dipc */
diff -u linux/arch/mips/kernel/scall64-64.S-o linux/arch/mips/kernel/scall64-64.S
--- linux/arch/mips/kernel/scall64-64.S-o	1970-01-01 01:12:51.000000000 +0100
+++ linux/arch/mips/kernel/scall64-64.S	2004-05-19 11:44:22.000000000 +0200
@@ -244,7 +244,7 @@
 	PTR	sys_setitimer
 	PTR	sys_alarm
 	PTR	sys_getpid
-	PTR	sys_sendfile
+	PTR	sys_sendfile64
 	PTR	sys_socket			/* 5040 */
 	PTR	sys_connect
 	PTR	sys_accept
diff -u linux/arch/ppc64/kernel/misc.S-o linux/arch/ppc64/kernel/misc.S
--- linux/arch/ppc64/kernel/misc.S-o	2004-05-19 11:32:12.000000000 +0200
+++ linux/arch/ppc64/kernel/misc.S	2004-05-19 11:43:33.000000000 +0200
@@ -1061,7 +1061,7 @@
 	.llong .sys_capget
 	.llong .sys_capset
 	.llong .sys_sigaltstack	        /* 185 */
-	.llong .sys_sendfile
+	.llong .sys_sendfile64
 	.llong .sys_ni_syscall		/* reserved for streams1 */
 	.llong .sys_ni_syscall		/* reserved for streams2 */
 	.llong .sys_vfork

             reply	other threads:[~2004-05-19  9:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19  9:49 Andi Kleen [this message]
2004-05-19 12:21 ` [PATCH] fixing sendfile on 64bit architectures Arnd Bergmann
2004-05-19 18:17 ` David Mosberger
2004-05-19 19:01   ` Andi Kleen
2004-05-19 19:13     ` David Mosberger
  -- strict thread matches above, loose matches on Subject: below --
2004-05-19 19:26 Arnd Bergmann
2004-05-20  6:19 ` David Mosberger
2004-05-20  6:41   ` David S. Miller

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=20040519114940.6b92cf1a.ak@suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    /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