mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 12:56:32 -04:00
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>
21 lines
473 B
Go
21 lines
473 B
Go
// 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)
|
|
}
|