github.com/llvm-mirror/llgo@v0.0.0-20190322182713-bf6f0a60fce1/third_party/gofrontend/libgo/go/syscall/libcall_bsd.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // BSD library calls. 6 7 package syscall 8 9 import "unsafe" 10 11 //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) 12 //sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t 13 func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 14 if raceenabled { 15 raceReleaseMerge(unsafe.Pointer(&ioSync)) 16 } 17 var soff Offset_t 18 var psoff *Offset_t 19 if offset != nil { 20 soff = Offset_t(*offset) 21 psoff = &soff 22 } 23 written, err = sendfile(outfd, infd, psoff, count) 24 if offset != nil { 25 *offset = int64(soff) 26 } 27 return 28 }