The writev syscall is available since at least Solaris 11.3.
Reuse the existing illumos writev wrapper on solaris to implement
internal/poll.writev for net.(*netFD).writeBuffers.
Change-Id: I23adc3bb4637740c72bfb61bfa9697b432dfe3db
Reviewed-on: https://go-review.googlesource.com/c/go/+/427714
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build illumos
-
package poll
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build illumos
-
package poll
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package poll
import (
"io"
+ "runtime"
"syscall"
)
// 1024 and this seems conservative enough for now. Darwin's
// UIO_MAXIOV also seems to be 1024.
maxVec := 1024
+ if runtime.GOOS == "solaris" {
+ // IOV_MAX is set to XOPEN_IOV_MAX on Solaris.
+ maxVec = 16
+ }
var n int64
var err error
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build illumos
-
package unix
import (
var wantSum int
switch runtime.GOOS {
- case "android", "darwin", "ios", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd":
+ case "android", "darwin", "ios", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
var wantMinCalls int
wantSum = want.Len()
v := chunks
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package net