This libgo patch by Nikhil Benesch removes sendfile from the syscall package on NetBSD, as NetBSD doesn't have the sendfile system call. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
76a9f0acd248bba801e6208d11a96db5b7f940dc diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 7496770f018..4ac0e8c6fc6 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -3b6252d2d3ce559826303dac07538da6e78940d8 +6662382a279dd5a5f99307e9b609654717638b24 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/syscall/libcall_bsd.go b/libgo/go/syscall/libcall_bsd.go deleted file mode 100644 index 93f5710ba03..00000000000 --- a/libgo/go/syscall/libcall_bsd.go +++ /dev/null @@ -1,31 +0,0 @@ -// 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 -} diff --git a/libgo/go/syscall/libcall_bsd_regfile.go b/libgo/go/syscall/libcall_bsd_regfile.go index 388c8a7d782..0b9d01f2fcf 100644 --- a/libgo/go/syscall/libcall_bsd_regfile.go +++ b/libgo/go/syscall/libcall_bsd_regfile.go @@ -2,7 +2,7 @@ // 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 diff --git a/libgo/go/syscall/libcall_bsd_sendfile.go b/libgo/go/syscall/libcall_bsd_sendfile.go new file mode 100644 index 00000000000..295a1f48969 --- /dev/null +++ b/libgo/go/syscall/libcall_bsd_sendfile.go @@ -0,0 +1,31 @@ +// 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 +}