unix: remove raw syscall from Sendfile

Update golang/go#17490

Change-Id: Iaec54b8ffda1a24d4c8b5671185d570fb8683155
Reviewed-on: https://go-review.googlesource.com/c/154663
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Keith Randall
2018-12-20 18:20:59 +00:00
committed by Keith Randall
parent 8588221f65
commit 7c4c994c65
25 changed files with 165 additions and 62 deletions
-14
View File
@@ -8,7 +8,6 @@ package unix
import (
"syscall"
"unsafe"
)
func setTimespec(sec, nsec int64) Timespec {
@@ -48,19 +47,6 @@ func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
var length = uint64(count)
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
written = int(length)
if e1 != 0 {
err = e1
}
return
}
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions