ipv4: drop the use of syscall package in platform-independent code

Change-Id: I5a8eac6e80fd2c9f4604231d51cb91d3b8514fea
Reviewed-on: https://go-review.googlesource.com/121882
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/ipv4/batch.go b/ipv4/batch.go
index b445499..5ce9b35 100644
--- a/ipv4/batch.go
+++ b/ipv4/batch.go
@@ -9,7 +9,6 @@
 import (
 	"net"
 	"runtime"
-	"syscall"
 
 	"golang.org/x/net/internal/socket"
 )
@@ -76,7 +75,7 @@
 // headers.
 func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
 	if !c.ok() {
-		return 0, syscall.EINVAL
+		return 0, errInvalidConn
 	}
 	switch runtime.GOOS {
 	case "linux":
@@ -107,7 +106,7 @@
 // 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
+		return 0, errInvalidConn
 	}
 	switch runtime.GOOS {
 	case "linux":
@@ -139,7 +138,7 @@
 // On other platforms, this method will read only a single message.
 func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) {
 	if !c.ok() {
-		return 0, syscall.EINVAL
+		return 0, errInvalidConn
 	}
 	switch runtime.GOOS {
 	case "linux":
@@ -170,7 +169,7 @@
 // On other platforms, this method will write only a single message.
 func (c *packetHandler) WriteBatch(ms []Message, flags int) (int, error) {
 	if !c.ok() {
-		return 0, syscall.EINVAL
+		return 0, errInvalidConn
 	}
 	switch runtime.GOOS {
 	case "linux":