Explorar o código

ipv6: enable {Read,Write}Batch methods of PacketConn on NetBSD

Change-Id: I7c88abdd74effca1cd8dd72970f0bee914e82fc2
Reviewed-on: https://go-review.googlesource.com/82457
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Mikio Hara %!s(int64=8) %!d(string=hai) anos
pai
achega
a0df083635
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      ipv6/batch.go

+ 4 - 4
ipv6/batch.go

@@ -63,14 +63,14 @@ type Message = socket.Message
 // On a successful read it returns the number of messages received, up
 // to len(ms).
 //
-// On Linux, a batch read will be optimized.
+// On Linux and NetBSD, a batch read will be optimized.
 // On other platforms, this method will read only a single message.
 func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
 	if !c.ok() {
 		return 0, syscall.EINVAL
 	}
 	switch runtime.GOOS {
-	case "linux":
+	case "linux", "netbsd":
 		n, err := c.RecvMsgs([]socket.Message(ms), flags)
 		if err != nil {
 			err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
@@ -94,14 +94,14 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
 //
 // It returns the number of messages written on a successful write.
 //
-// On Linux, a batch write will be optimized.
+// On Linux and NetBSD, a batch write will be optimized.
 // On other platforms, this method will write only a single message.
 func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) {
 	if !c.ok() {
 		return 0, syscall.EINVAL
 	}
 	switch runtime.GOOS {
-	case "linux":
+	case "linux", "netbsd":
 		n, err := c.SendMsgs([]socket.Message(ms), flags)
 		if err != nil {
 			err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}