diff options
author | Wim <wim@42.be> | 2020-05-24 00:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 00:06:21 +0200 |
commit | 393f9e998b1b40aa59d3fb8794c3a73da38c3fb7 (patch) | |
tree | 2bc9b6e6abdbdc6d811b155997597bdae62bc7db /vendor/golang.org/x/sys/unix/syscall_illumos.go | |
parent | ba0bfe70a8f07164e1341f4b094841acdad5c3a2 (diff) | |
download | matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.gz matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.bz2 matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.zip |
Update dependencies / vendor (#1146)
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_illumos.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_illumos.go | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go new file mode 100644 index 00000000..99e62dcd --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go @@ -0,0 +1,57 @@ +// Copyright 2009 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. + +// illumos system calls not present on Solaris. + +// +build amd64,illumos + +package unix + +import "unsafe" + +func bytes2iovec(bs [][]byte) []Iovec { + iovecs := make([]Iovec, len(bs)) + for i, b := range bs { + iovecs[i].SetLen(len(b)) + if len(b) > 0 { + // somehow Iovec.Base on illumos is (*int8), not (*byte) + iovecs[i].Base = (*int8)(unsafe.Pointer(&b[0])) + } else { + iovecs[i].Base = (*int8)(unsafe.Pointer(&_zero)) + } + } + return iovecs +} + +//sys readv(fd int, iovs []Iovec) (n int, err error) + +func Readv(fd int, iovs [][]byte) (n int, err error) { + iovecs := bytes2iovec(iovs) + n, err = readv(fd, iovecs) + return n, err +} + +//sys preadv(fd int, iovs []Iovec, off int64) (n int, err error) + +func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) { + iovecs := bytes2iovec(iovs) + n, err = preadv(fd, iovecs, off) + return n, err +} + +//sys writev(fd int, iovs []Iovec) (n int, err error) + +func Writev(fd int, iovs [][]byte) (n int, err error) { + iovecs := bytes2iovec(iovs) + n, err = writev(fd, iovecs) + return n, err +} + +//sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error) + +func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) { + iovecs := bytes2iovec(iovs) + n, err = pwritev(fd, iovecs, off) + return n, err +} |