svipc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 2 Imported by: 13

README

Pure Go SysV IPC

This library implements SysV IPC commands on Linux using system calls rather than cgo.

Shared memory access is implemented and fairly well tested. Semaphores are partially implemented. Messages queues are not yet implemented.

API not yet fixed.

Documentation

Index

Constants

View Source
const (
	SHM_R = 0400
	SHM_W = 0200

	SHM_RDONLY = 010000
	SHM_RND    = 020000
	SHM_REMAP  = 040000
	SHM_EXEC   = 0100000

	SHM_LOCK      = 11
	SHM_UNLOCK    = 12
	SHM_STAT      = 13
	SHM_INFO      = 14
	SHM_DEST      = 01000
	SHM_LOCKED    = 02000
	SHM_HUGETLB   = 04000
	SHM_NORESERVE = 010000

	IPC_CREAT  = 01000
	IPC_EXCL   = 02000
	IPC_NOWAIT = 04000

	IPC_RMID = 0
	IPC_SET  = 1
	IPC_STAT = 2
	IPC_INFO = 3

	SEM_UNDO = 0x1000
	GETPID   = 11
	GETVAL   = 12
	GETALL   = 13
	GETNCNT  = 14
	GETZCNT  = 15
	SETVAL   = 16
	SETALL   = 17

	SEM_STAT = 18
	SEM_INFO = 19
)

Variables

This section is empty.

Functions

func Semctl

func Semctl(id uintptr, num int, cmd int) (ret int, err error)

func Semget

func Semget(key IpcKey, nsems int, flags int) (id uintptr, err error)

func Semop

func Semop(id uintptr, buf unsafe.Pointer, n int) (err error)

func Shmat

func Shmat(id uintptr, tagaddr uintptr, flags int) (addr unsafe.Pointer, err error)

func Shmctl

func Shmctl(id uintptr, cmd uintptr, shmid *ShmId) (err error)

func Shmdt

func Shmdt(addr unsafe.Pointer) (err error)

func Shmget

func Shmget(key IpcKey, size uintptr, flags int) (id uintptr, err error)

Types

type IpcKey

type IpcKey int32

func Ftok

func Ftok(path string, id uint64) (IpcKey, error)

type IpcPerm

type IpcPerm struct {
	Key  IpcKey
	Uid  uint32
	Gid  uint32
	Cuid uint32
	Cgid uint32
	Mode uint16

	Seq uint16
	// contains filtered or unexported fields
}

type SemId

type SemId struct {
	Perm  IpcPerm
	Otime int64

	Ctime int64

	Nsems uint64
	// contains filtered or unexported fields
}

type ShmId

type ShmId struct {
	Perm   IpcPerm
	Segsz  uint64
	Atime  int64
	Dtime  int64
	Ctime  int64
	Cpid   int32
	Lpid   int32
	Nattch uint64
	// contains filtered or unexported fields
}

type ShmInfo

type ShmInfo struct {
	Shmmax uint64
	Shmmin uint64
	Shmmni uint64
	Shmseg uint64
	Shmall uint64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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