diff --git a/common/rw/writev_posix.go b/common/rw/writev_posix.go deleted file mode 100644 index 9758b98d..00000000 --- a/common/rw/writev_posix.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build !windows - -package rw - -import ( - "syscall" - "unsafe" -) - -// Deprecated: use vectorised writer -func WriteV(fd uintptr, data [][]byte) (int, error) { - iovecs := make([]syscall.Iovec, len(data)) - for i := range iovecs { - iovecs[i].Base = &data[i][0] - iovecs[i].SetLen(len(data[i])) - } - var ( - r uintptr - e syscall.Errno - ) - for { - r, _, e = syscall.Syscall(syscall.SYS_WRITEV, fd, uintptr(unsafe.Pointer(&iovecs[0])), uintptr(len(iovecs))) - if e != syscall.EINTR { - break - } - } - if e != 0 { - return 0, e - } - return int(r), nil -} diff --git a/common/rw/writev_windows.go b/common/rw/writev_windows.go deleted file mode 100644 index ae1e5add..00000000 --- a/common/rw/writev_windows.go +++ /dev/null @@ -1,19 +0,0 @@ -package rw - -import ( - "syscall" -) - -// Deprecated: use vectorised writer -func WriteV(fd uintptr, data [][]byte) (int, error) { - var n uint32 - buffers := make([]*syscall.WSABuf, len(data)) - for i, buf := range data { - buffers[i] = &syscall.WSABuf{ - Len: uint32(len(buf)), - Buf: &buf[0], - } - } - err := syscall.WSASend(syscall.Handle(fd), buffers[0], uint32(len(buffers)), &n, 0, nil, nil) - return int(n), err -}