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// +build darwin dragonfly freebsd netbsd openbsd solaris 6 7// BSD library calls. 8 9package syscall 10 11import ( 12 "internal/race" 13 "unsafe" 14) 15 16func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 17 if race.Enabled { 18 race.ReleaseMerge(unsafe.Pointer(&ioSync)) 19 } 20 var soff Offset_t 21 var psoff *Offset_t 22 if offset != nil { 23 soff = Offset_t(*offset) 24 psoff = &soff 25 } 26 written, err = sendfile(outfd, infd, psoff, count) 27 if offset != nil { 28 *offset = int64(soff) 29 } 30 return 31} 32