shm

package
v0.0.0-...-3441017 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package shm provides a way to use System V shared memory.

Index

Constants

View Source
const (
	// O_RDONLY opens the file read-only.
	O_RDONLY int = syscall.O_RDONLY
	// O_WRONLY opens the file write-only.
	O_WRONLY int = syscall.O_WRONLY
	// O_RDWR opens the file read-write.
	O_RDWR int = syscall.O_RDWR

	// O_CREATE creates a new file if none exists.
	O_CREATE int = syscall.O_CREAT
)
View Source
const (
	// IPC_CREAT creates if key is nonexistent
	IPC_CREAT = 01000

	// IPC_EXCL fails if key exists.
	IPC_EXCL = 02000

	// IPC_NOWAIT returns error no wait.
	IPC_NOWAIT = 04000

	// IPC_PRIVATE is private key
	IPC_PRIVATE = 00000

	// SEM_UNDO sets up adjust on exit entry
	SEM_UNDO = 010000

	// IPC_RMID removes identifier
	IPC_RMID = 0
	// IPC_SET sets ipc_perm options.
	IPC_SET = 1
	// IPC_STAT gets ipc_perm options.
	IPC_STAT = 2
)
View Source
const (
	// SYS_SHMGET is syscall SYS_SHMGET constant
	SYS_SHMGET = syscall.SYS_SHMGET
	// SYS_SHMAT is syscall SYS_SHMAT constant
	SYS_SHMAT = syscall.SYS_SHMAT
	// SYS_SHMDT is syscall SYS_SHMDT constant
	SYS_SHMDT = syscall.SYS_SHMDT
	// SYS_SHMCTL is syscall SYS_SHMCTL constant
	SYS_SHMCTL = syscall.SYS_SHMCTL
)

Variables

View Source
var (
	// ErrUnmappedMemory is returned when a function is called on unmapped memory.
	ErrUnmappedMemory = errors.New("unmapped memory")
	// ErrIndexOutOfBound is returned when given offset lies beyond the mapped region.
	ErrIndexOutOfBound = errors.New("offset out of mapped region")
)

Functions

func NewShm

func NewShm(size int) (*shm, error)

NewShm calls the shmget and shmat system call.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL