mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 06:46:44 -04:00
unix: add Sysv shared memory support
Implements proposed API from https://golang.org/issue/46084. I chose `SysvShmDesc` since it's a clearer name than `SysvShm`. Initially supports Darwin and Linux. Solaris support has a blocker (https://golang.org/issue/46084#issuecomment-836980018) For golang/go#46084 Change-Id: Ied0f768a74c448254adc3315348417825a7ec63e GitHub-Last-Rev: befbd7af6b2f838753ac163ef387cebdb7957467 GitHub-Pull-Request: golang/sys#110 Reviewed-on: https://go-review.googlesource.com/c/sys/+/327830 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
39ccf1dd6f
commit
969570ce7c
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user