Fix tests on ARM

This commit is contained in:
Dustin Spicuzza
2021-07-02 13:10:32 -04:00
parent e574f34d5f
commit 3aa34d7e9a
5 changed files with 37 additions and 5 deletions

View File

@@ -3848,6 +3848,8 @@ const (
IPC_EXCL = C.IPC_EXCL
IPC_NOWAIT = C.IPC_NOWAIT
IPC_PRIVATE = C.IPC_PRIVATE
ipc_64 = C.IPC_64
)
const (

20
unix/sysvshm_linux.go Normal file
View File

@@ -0,0 +1,20 @@
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux
// +build linux
package unix
import "runtime"
// SysvShmCtl performs control operations on the shared memory segment
// specified by id.
func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
if runtime.GOARCH == "arm" {
cmd |= ipc_64
}
return shmctl(id, cmd, desc)
}

View File

@@ -42,11 +42,7 @@ func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) {
return b, nil
}
// SysvShmCtl performs control operations on the shared memory segment
// specified by id.
func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
return shmctl(id, cmd, desc)
}
// SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach.
//

View File

@@ -0,0 +1,12 @@
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (darwin && amd64)
// +build darwin,amd64
// SysvShmCtl performs control operations on the shared memory segment
// specified by id.
func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
return shmctl(id, cmd, desc)
}

View File

@@ -3942,6 +3942,8 @@ const (
IPC_EXCL = 0x400
IPC_NOWAIT = 0x800
IPC_PRIVATE = 0x0
ipc_64 = 0x100
)
const (