From def9a9ee0ddc3bf6dc59881fdda36e98084c361c Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Sun, 19 Jul 2020 06:48:18 -0600 Subject: [PATCH] unix: Add SetBase for IovecRemote This is needed to portably set Base without platform-specific code. --- unix/syscall_linux_386.go | 4 ++++ unix/syscall_linux_amd64.go | 4 ++++ unix/syscall_linux_arm.go | 4 ++++ unix/syscall_linux_arm64.go | 4 ++++ unix/syscall_linux_mips64x.go | 4 ++++ unix/syscall_linux_mipsx.go | 4 ++++ unix/syscall_linux_ppc64x.go | 4 ++++ unix/syscall_linux_riscv64.go | 4 ++++ unix/syscall_linux_s390x.go | 4 ++++ unix/syscall_linux_sparc64.go | 4 ++++ 10 files changed, 40 insertions(+) diff --git a/unix/syscall_linux_386.go b/unix/syscall_linux_386.go index e5c480e0..0ee5cde8 100644 --- a/unix/syscall_linux_386.go +++ b/unix/syscall_linux_386.go @@ -380,6 +380,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint32(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint32(length) } diff --git a/unix/syscall_linux_amd64.go b/unix/syscall_linux_amd64.go index cbf368d1..5a1ca773 100644 --- a/unix/syscall_linux_amd64.go +++ b/unix/syscall_linux_amd64.go @@ -171,6 +171,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_arm.go b/unix/syscall_linux_arm.go index cbcc5e81..f37f1f3f 100644 --- a/unix/syscall_linux_arm.go +++ b/unix/syscall_linux_arm.go @@ -260,6 +260,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint32(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint32(length) } diff --git a/unix/syscall_linux_arm64.go b/unix/syscall_linux_arm64.go index 3408b6a0..0ee9d3c9 100644 --- a/unix/syscall_linux_arm64.go +++ b/unix/syscall_linux_arm64.go @@ -206,6 +206,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_mips64x.go b/unix/syscall_linux_mips64x.go index a6cad77d..b8ad4b5f 100644 --- a/unix/syscall_linux_mips64x.go +++ b/unix/syscall_linux_mips64x.go @@ -216,6 +216,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_mipsx.go b/unix/syscall_linux_mipsx.go index 9803d167..71e63fb2 100644 --- a/unix/syscall_linux_mipsx.go +++ b/unix/syscall_linux_mipsx.go @@ -228,6 +228,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint32(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint32(length) } diff --git a/unix/syscall_linux_ppc64x.go b/unix/syscall_linux_ppc64x.go index ae52bc3c..fead4b03 100644 --- a/unix/syscall_linux_ppc64x.go +++ b/unix/syscall_linux_ppc64x.go @@ -99,6 +99,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_riscv64.go b/unix/syscall_linux_riscv64.go index e2328a61..e5de0b92 100644 --- a/unix/syscall_linux_riscv64.go +++ b/unix/syscall_linux_riscv64.go @@ -187,6 +187,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_s390x.go b/unix/syscall_linux_s390x.go index 2a25b9f2..14b82d0a 100644 --- a/unix/syscall_linux_s390x.go +++ b/unix/syscall_linux_s390x.go @@ -128,6 +128,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) } diff --git a/unix/syscall_linux_sparc64.go b/unix/syscall_linux_sparc64.go index f0b429e1..7d3a54b4 100644 --- a/unix/syscall_linux_sparc64.go +++ b/unix/syscall_linux_sparc64.go @@ -115,6 +115,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (iov *IovecRemote) SetBase(length uintptr) { + iov.Base = uint64(length) +} + func (iov *IovecRemote) SetLen(length int) { iov.Len = uint64(length) }