fix sendfile syscall to use 64-bit off_t
authorRich Felker <dalias@aerifal.cx>
Fri, 6 Jun 2014 21:56:36 +0000 (17:56 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 6 Jun 2014 21:56:36 +0000 (17:56 -0400)
somehow the remapping of this syscall to the 64-bit version was
overlooked. the issue was found, and patch provided, by Stefan
Kristiansson. presumably the reason this bug was not caught earlier is
that the syscall takes a pointer to off_t rather than a value, so on
little-endian systems, everything appears to work as long as the
offset value fits in the low 31 bits. on big-endian systems, though,
sendfile was presumably completely non-functional.

corresponds to commit 55f45bc7222ec50b72aa8411c61e30184d0ade23 in
master branch.

src/internal/syscall.h

index dcfae003b123265b565a97e7344c05f33a1d07c5..d0fe107e726c297f46969240a4ee6b5e23b75cc5 100644 (file)
@@ -163,4 +163,9 @@ long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
 #define SYS_fadvise SYS_fadvise64_64
 #endif
 
+#ifdef SYS_sendfile64
+#undef SYS_sendfile
+#define SYS_sendfile SYS_sendfile64
+#endif
+
 #endif