# DP: libgo: syscall.Sendfile(): Apply proposed patch for PR go/66378. From: Michael Vogt Description: syscall.Sendfile() needs to set the offset. Previously it was not setting or using the user provided offset at all. See sendfile(2) for details about the semantic of "offset". Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gccgo-5/+bug/1460530 Index: b/src/libgo/go/syscall/libcall_linux.go =================================================================== --- a/src/libgo/go/syscall/libcall_linux.go +++ b/src/libgo/go/syscall/libcall_linux.go @@ -318,21 +318,13 @@ func Pipe2(p []int, flags int) (err erro //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //renameat(olddirfd _C_int, oldpath *byte, newdirfd _C_int, newpath *byte) _C_int -//sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) -//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t +//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +//sendfile64(outfd _C_int, infd _C_int, offset *int64, count Size_t) Ssize_t func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } - var soff Offset_t - var psoff *Offset_t - if offset != nil { - psoff = &soff - } - written, err = sendfile(outfd, infd, psoff, count) - if offset != nil { - *offset = int64(soff) - } + written, err = sendfile(outfd, infd, offset, count) return }