Documentation
¶
Overview ¶
Package sysvipc provides access to System V inter-process communication mechanisms.
Index ¶
- Constants
- func Ftok(path string, id uint8) (int, error)
- func Msgctl(id, cmd int, arg any) (int, error)
- func Msgget(key, flag int) (int, error)
- func Msgrcv(id int, msg []byte, typ, flag int) (int, error)
- func Msgsnd(id int, msg []byte, flag int) error
- func Semctl(id, num, cmd int, arg any) (int, error)
- func Semget(key, nsems, flag int) (int, error)
- func Semop(id int, ops []Sembuf) error
- func Semtimedmop(id int, ops []Sembuf, timeout time.Duration) (err error)
- func Shmat(id int, addr uintptr, flag int) ([]byte, error)
- func Shmctl(id, cmd int, arg any) (int, error)
- func Shmdt(data []byte) error
- func Shmget(key, size, flag int) (int, error)
- type MsgDesc
- type MsgInfo
- type Perm
- type SemDesc
- type SemInfo
- type Sembuf
- type ShmDesc
- type ShmInfo
- type ShmSystemInfo
Constants ¶
const ( IPC_CREAT = unix.IPC_CREAT // Create entry if key does not exist IPC_EXCL = unix.IPC_EXCL // Fail if key exists IPC_NOWAIT = unix.IPC_NOWAIT // Error if request must wait )
Mode bits.
const ( IPC_RMID = unix.IPC_RMID // Remove identifier IPC_SET = unix.IPC_SET // Set options IPC_STAT = unix.IPC_STAT // Get options )
Control commands.
const ( IPC_R = 0o000400 // Read permission IPC_W = 0o000200 // Write/alter permission IPC_M = 0o010000 // Modify control info permission )
Common mode bits.
const ( MSG_STAT = 11 MSG_INFO = 12 MSG_STAT_ANY = 13 )
Additional commands for Msgctl.
const ( GETPID = 11 // get sempid GETVAL = 12 // get semval GETALL = 13 // get all semval's GETNCNT = 14 // get semncnt GETZCNT = 15 // get semzcnt SETVAL = 16 // set semval SETALL = 17 // set all semval's SEM_STAT = 18 SEM_INFO = 19 SEM_STAT_ANY = 20 )
Additional commands for semctl.
const ( SEM_DEST = 0o2000 // Semaphore will be destroyed on last detach SEM_LOCKED = 0o4000 // Semaphore set is locked )
const ( SHM_RDONLY = unix.SHM_RDONLY // read-only access SHM_RND = unix.SHM_RND // round attach address to SHMLBA boundary )
Possible flag values for Shmat.
const ( SHM_REMAP = 0o040000 // take-over region on attach SHM_EXEC = 0o0100000 // execution access )
Additional flag values for Shmat.
const ( SHM_LOCK = 11 SHM_UNLOCK = 12 SHM_STAT = 13 SHM_INFO = 14 SHM_STAT_ANY = 15 )
Additional commands for Shmctl.
const (
IPC_INFO = 3
)
Additional commands for Msgctl, Semctl, Shmctl.
const IPC_PRIVATE = unix.IPC_PRIVATE
Private key.
If this special value is used for key, the system call ignores everything but the least significant 9 bits of the flag argument to Msgget, Semget or Shmget and creates a new message queue, semaphore set or shared memory segment.
const (
MSG_NOERROR = 0o010000 // no error if message is too big
)
Possible values for the fifth parameter to Msgrcv, in addition to the IPC_NOWAIT flag, which is permitted.
const (
SEM_UNDO = 0x1000 // undo the operation on exit
)
Possible flag values for Semop.
Variables ¶
This section is empty.
Functions ¶
func Msgctl ¶
Msgctl corresponds to msgctl.
arg can be of type:
*MsgControl IPC_STAT, IPC_SET, MSG_STAT, MSG_STAT_ANY *MsgInfo IPC_INFO, MSG_INFO
func Semctl ¶
Semctl corresponds to semctl.
arg can be of type:
*SemControl IPC_STAT, IPC_SET, SEM_STAT, SEM_STAT_ANY *SemInfo IPC_INFO, SEM_INFO []uint16 GETALL, SETALL int32 SETVAL
func Semtimedmop ¶
Semtimedop corresponds to semtimedop.
Types ¶
type MsgDesc ¶
type MsgDesc struct {
// contains filtered or unexported fields
}
MsgDesc corresponds to struct msqid_ds.
type MsgInfo ¶
type MsgInfo struct {
Pool int32 // size in kibibytes of buffer pool (unused within kernel)
Map int32 // max number of entries in message map (unused within kernel)
Max int32 // max number of bytes per message
Mnb int32 // max number of bytes on queue
Mni int32 // max number of message queues
Ssz int32 // message segment size (unused within kernel)
Tql int32 // max number of messages on all queues (unused within kernel)
Seg uint16 // max number of segments (unused within kernel)
// contains filtered or unexported fields
}
MsgInfo corresponds to struct msginfo.
type Perm ¶
type Perm struct {
// contains filtered or unexported fields
}
Perm corresponds to struct ipc_perm.
type SemDesc ¶
type SemDesc struct {
// contains filtered or unexported fields
}
SemDesc corresponds to struct semid_ds.
type SemInfo ¶
type SemInfo struct {
Map int32 // Number of entries in semaphore map; unused within kernel
Mni int32 // Maximum number of semaphore sets
Mns int32 // Maximum number of semaphores in all semaphore sets
Mnu int32 // System-wide maximum number of undo structures; unused within kernel
Msl int32 // Maximum number of semaphores in a set
Opm int32 // Maximum number of operations for semop
Ume int32 // Maximum number of undo entries per process; unused within kernel
Usz int32 // Size of struct sem_undo
Vmx int32 // Maximum semaphore value
Aem int32 // Maximum value that can be recorded for semaphore adjustment (SEM_UNDO)
// contains filtered or unexported fields
}
type ShmDesc ¶
type ShmDesc struct {
// contains filtered or unexported fields
}
ShmDesc corresponds to struct shmid_ds.
type ShmInfo ¶
type ShmInfo struct {
UsedIDs int32 // number of currently existing segments
ShmTot uint // total number of shared memory pages
ShmRss uint // number of resident shared memory pages
ShmSwp uint // number of swapped shared memory pages
SwapAttempts uint // unused since Linux 2.4
SwapSuccesses uint // unused since Linux 2.4
// contains filtered or unexported fields
}
ShmInfo corresponds to struct shm_info.
type ShmSystemInfo ¶
type ShmSystemInfo struct {
Max uint // maximum segment size
Min uint // minimum segment size; always 1
Mni uint // maximum number of segments
Seg uint // maximum number of segments that a process can attach (unused within kernel)
All uint // maximum number of pages of shared memory, system-wide
// contains filtered or unexported fields
}
ShmSystemInfo corresponds to struct shminfo64.