...

Source file src/net/writev_unix.go

Documentation: net

		 1  // Copyright 2016 The Go Authors. All rights reserved.
		 2  // Use of this source code is governed by a BSD-style
		 3  // license that can be found in the LICENSE file.
		 4  
		 5  //go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
		 6  // +build darwin dragonfly freebsd illumos linux netbsd openbsd
		 7  
		 8  package net
		 9  
		10  import (
		11  	"runtime"
		12  	"syscall"
		13  )
		14  
		15  func (c *conn) writeBuffers(v *Buffers) (int64, error) {
		16  	if !c.ok() {
		17  		return 0, syscall.EINVAL
		18  	}
		19  	n, err := c.fd.writeBuffers(v)
		20  	if err != nil {
		21  		return n, &OpError{Op: "writev", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err}
		22  	}
		23  	return n, nil
		24  }
		25  
		26  func (fd *netFD) writeBuffers(v *Buffers) (n int64, err error) {
		27  	n, err = fd.pfd.Writev((*[][]byte)(v))
		28  	runtime.KeepAlive(fd)
		29  	return n, wrapSyscallError("writev", err)
		30  }
		31  

View as plain text