diff options
Diffstat (limited to 'pkg/tcpip/link/rawfile')
-rw-r--r-- | pkg/tcpip/link/rawfile/rawfile_unsafe.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/pkg/tcpip/link/rawfile/rawfile_unsafe.go b/pkg/tcpip/link/rawfile/rawfile_unsafe.go index 261d350d7..cea3cd6a1 100644 --- a/pkg/tcpip/link/rawfile/rawfile_unsafe.go +++ b/pkg/tcpip/link/rawfile/rawfile_unsafe.go @@ -94,29 +94,6 @@ func NonBlockingWrite2(fd int, b1, b2 []byte) *tcpip.Error { return nil } -// NonBlockingWriteN writes up to N byte slices to a file descriptor in a -// single syscall. It fails if partial data is written. -func NonBlockingWriteN(fd int, bs ...[]byte) *tcpip.Error { - iovec := make([]syscall.Iovec, 0, len(bs)) - - for _, b := range bs { - if len(b) == 0 { - continue - } - iovec = append(iovec, syscall.Iovec{ - Base: &b[0], - Len: uint64(len(b)), - }) - } - - _, _, e := syscall.RawSyscall(syscall.SYS_WRITEV, uintptr(fd), uintptr(unsafe.Pointer(&iovec[0])), uintptr(len(iovec))) - if e != 0 { - return TranslateErrno(e) - } - - return nil -} - type pollEvent struct { fd int32 events int16 |