internal/socket: use unix cmsg functions on zos

Use the equivalent implementation already present in cmsghdr_unix.go.

Change-Id: Iae7a8d2509437523ae15dae2ae99720745cd17c3
Reviewed-on: https://go-review.googlesource.com/c/net/+/380874
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/internal/socket/cmsghdr_unix.go b/internal/socket/cmsghdr_unix.go
index aa1b062..19d4678 100644
--- a/internal/socket/cmsghdr_unix.go
+++ b/internal/socket/cmsghdr_unix.go
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
 
 package socket
 
diff --git a/internal/socket/cmsghdr_zos_s390x.go b/internal/socket/cmsghdr_zos_s390x.go
index 98be146..68dc8ad 100644
--- a/internal/socket/cmsghdr_zos_s390x.go
+++ b/internal/socket/cmsghdr_zos_s390x.go
@@ -4,22 +4,8 @@
 
 package socket
 
-import "syscall"
-
 func (h *cmsghdr) set(l, lvl, typ int) {
 	h.Len = int32(l)
 	h.Level = int32(lvl)
 	h.Type = int32(typ)
 }
-
-func controlHeaderLen() int {
-	return syscall.CmsgLen(0)
-}
-
-func controlMessageLen(dataLen int) int {
-	return syscall.CmsgLen(dataLen)
-}
-
-func controlMessageSpace(dataLen int) int {
-	return syscall.CmsgSpace(dataLen)
-}