* combine.c (try_combine): Don't ignore result of overlap checking
[official-gcc.git] / libgo / go / syscall / libcall_bsd.go
blob9a4b2d65825fe985c8a59b56f03f7fb86eb53461
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.
5 // +build darwin dragonfly freebsd netbsd openbsd solaris
7 // BSD library calls.
9 package syscall
11 import (
12 "internal/race"
13 "unsafe"
16 //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error)
17 //sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
18 func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
19 if race.Enabled {
20 race.ReleaseMerge(unsafe.Pointer(&ioSync))
22 var soff Offset_t
23 var psoff *Offset_t
24 if offset != nil {
25 soff = Offset_t(*offset)
26 psoff = &soff
28 written, err = sendfile(outfd, infd, psoff, count)
29 if offset != nil {
30 *offset = int64(soff)
32 return