Retro68/gcc/libgo/go/syscall/libcall_bsd_sendfile.go
2022-10-27 20:55:19 +02:00

32 lines
664 B
Go

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd openbsd solaris
// BSD sendfile support.
package syscall
import (
"internal/race"
"unsafe"
)
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
if race.Enabled {
race.ReleaseMerge(unsafe.Pointer(&ioSync))
}
var soff Offset_t
var psoff *Offset_t
if offset != nil {
soff = Offset_t(*offset)
psoff = &soff
}
written, err = sendfile(outfd, infd, psoff, count)
if offset != nil {
*offset = int64(soff)
}
return
}