NetBSD does not support the sendfile syscall.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263521
-3b6252d2d3ce559826303dac07538da6e78940d8
+6662382a279dd5a5f99307e9b609654717638b24
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
+++ /dev/null
-// 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 netbsd openbsd solaris
-
-// BSD library calls.
-
-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
-}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin dragonfly freebsd netbsd openbsd solaris,amd64 solaris,sparc64
+// +build darwin dragonfly freebsd openbsd solaris,amd64 solaris,sparc64
package syscall
--- /dev/null
+// 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
+}