Source file
src/net/writev_unix.go
1
2
3
4
5
6
7 package net
8
9 import (
10 "runtime"
11 "syscall"
12 )
13
14 func (c *conn) writeBuffers(v *Buffers) (int64, error) {
15 if !c.ok() {
16 return 0, syscall.EINVAL
17 }
18 n, err := c.fd.writeBuffers(v)
19 if err != nil {
20 return n, &OpError{Op: "writev", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err}
21 }
22 return n, nil
23 }
24
25 func (fd *netFD) writeBuffers(v *Buffers) (n int64, err error) {
26 n, err = fd.pfd.Writev((*[][]byte)(v))
27 runtime.KeepAlive(fd)
28 return n, wrapSyscallError("writev", err)
29 }
30
View as plain text