diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2022-10-04 13:53:46 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-10-07 16:48:38 +0000 |
| commit | 5ca0cd3f1824f189b6c5edf59b669f22a393e2e1 (patch) | |
| tree | fa7ef497ea57333ad40e938ffd4a4f0d41022b3e /src/internal/syscall | |
| parent | cabf9fe4f2d7e5adfa7007e11f508b111d07a2f6 (diff) | |
| download | go-5ca0cd3f1824f189b6c5edf59b669f22a393e2e1.tar.xz | |
internal/poll, internal/syscall/unix, syscall: move writev definition for solaris
Move the writev definition for solaris from package
internal/syscall/unix to package syscall. This corresponds to where
writev is defined on aix, darwin and openbsd as well and is
go:linkname'ed from internal/poll. This also allows updating the
generated wrappers more easily if needed.
Change-Id: I671ed8232d25319f8e63f549f786d77a17602148
Reviewed-on: https://go-review.googlesource.com/c/go/+/436597
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/internal/syscall')
| -rw-r--r-- | src/internal/syscall/unix/writev_solaris.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/internal/syscall/unix/writev_solaris.go b/src/internal/syscall/unix/writev_solaris.go deleted file mode 100644 index d4895eef9e..0000000000 --- a/src/internal/syscall/unix/writev_solaris.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020 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. - -package unix - -import ( - "syscall" - "unsafe" -) - -//go:cgo_import_dynamic libc_writev writev "libc.so" - -//go:linkname procwritev libc_writev - -var procwritev uintptr - -func Writev(fd int, iovs []syscall.Iovec) (uintptr, error) { - var p *syscall.Iovec - if len(iovs) > 0 { - p = &iovs[0] - } - n, _, errno := syscall6(uintptr(unsafe.Pointer(&procwritev)), 3, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(len(iovs)), 0, 0, 0) - if errno != 0 { - return 0, errno - } - return n, nil -} |
