mirror of
https://github.com/golang/sys.git
synced 2026-02-09 04:06:04 +03:00
Fix tests on ARM
This commit is contained in:
@@ -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
20
unix/sysvshm_linux.go
Normal 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)
|
||||
}
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
12
unix/sysvshm_unix_other.go
Normal file
12
unix/sysvshm_unix_other.go
Normal 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)
|
||||
}
|
||||
@@ -3942,6 +3942,8 @@ const (
|
||||
IPC_EXCL = 0x400
|
||||
IPC_NOWAIT = 0x800
|
||||
IPC_PRIVATE = 0x0
|
||||
|
||||
ipc_64 = 0x100
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user