From: Rich Felker Date: Fri, 30 May 2014 05:12:42 +0000 (-0400) Subject: fix sendfile syscall to use 64-bit off_t X-Git-Tag: v1.1.2~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=55f45bc7222ec50b72aa8411c61e30184d0ade23;p=oweals%2Fmusl.git fix sendfile syscall to use 64-bit off_t 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. --- diff --git a/src/internal/syscall.h b/src/internal/syscall.h index 08a85784..3f4490e1 100644 --- a/src/internal/syscall.h +++ b/src/internal/syscall.h @@ -163,6 +163,11 @@ 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 + /* socketcall calls */ #define __SC_socket 1