summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGoogler <noreply@google.com>2019-02-24 17:30:53 -0800
committerShentubot <shentubot@google.com>2019-02-24 17:31:59 -0800
commit317c0324c9c73e1c6d6c9cfa7e9cdbfbf1f63b06 (patch)
tree129b28b81c02842d9b63ad288da3303e40f708c5
parentb75aa515044367094e762985a4b1a1f0580e3ad6 (diff)
Internal change.
PiperOrigin-RevId: 235447861 Change-Id: Ic6ba5e0ed89f1b85651da084be70ef8d0ffc13cf
-rw-r--r--pkg/unet/unet_unsafe.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/unet/unet_unsafe.go b/pkg/unet/unet_unsafe.go
index 1d69de542..1d6ec286c 100644
--- a/pkg/unet/unet_unsafe.go
+++ b/pkg/unet/unet_unsafe.go
@@ -87,7 +87,9 @@ func buildIovec(bufs [][]byte, iovecs []syscall.Iovec) ([]syscall.Iovec, int) {
return iovecs, length
}
-// ReadVec implements vecio.Reader.ReadVec.
+// ReadVec reads into the pre-allocated bufs. Returns bytes read.
+//
+// The pre-allocatted space used by ReadVec is based upon slice lengths.
//
// This function is not guaranteed to read all available data, it
// returns as soon as a single recvmsg call succeeds.
@@ -160,7 +162,7 @@ func (r *SocketReader) ReadVec(bufs [][]byte) (int, error) {
}
// All unet sockets are SOCK_STREAM or SOCK_SEQPACKET, both of which
- // indicate that the other end is closed by returning a 0-length read
+ // indicate that the other end is closed by returning a 0 length read
// with no error.
if n == 0 {
return 0, io.EOF
@@ -178,7 +180,7 @@ func (r *SocketReader) ReadVec(bufs [][]byte) (int, error) {
return int(n), nil
}
-// WriteVec implements vecio.Writer.WriteVec.
+// WriteVec writes the bufs to the socket. Returns bytes written.
//
// This function is not guaranteed to send all data, it returns
// as soon as a single sendmsg call succeeds.