Documentation
¶
Overview ¶
Package msg provides a way to use System V message queues.
Index ¶
- Constants
- Variables
- func Get(key int, msgflg int) (int, error)
- func Rcv(msgid int, msgp uintptr, msgsz int, msgtyp uint, msgflg int) (int, error)
- func Receive(msgid int, msgType uint, flags int) ([]byte, error)
- func Remove(msgid int) error
- func Send(msgid int, msgType uint, msgText []byte, flags int) error
- func Snd(msgid int, msgp uintptr, msgsz int, msgflg int) error
Constants ¶
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 )
Variables ¶
var ErrTooLong = errors.New("Text length is too long")
ErrTooLong is returned when the Text length is bigger than maxText.
Functions ¶
func Snd ¶
Snd calls the msgsnd system call.
The msgsnd() and msgrcv() system calls are used to send messages to, and receive messages from, a System V message queue. The calling process must have write permission on the message queue in order to send a message, and read permission to receive a message. The msgp argument is a pointer to a caller-defined structure of the following general form:
struct msgbuf { long mtype; /* message type, must be > 0 */ char mtext[1]; /* message data */ };
The mtext field is an array (or other structure) whose size is speci‐ fied by msgsz, a nonnegative integer value. Messages of zero length (i.e., no mtext field) are permitted. The mtype field must have a strictly positive integer value. This value can be used by the re‐ ceiving process for message selection (see the description of ms‐ grcv() below).
Types ¶
This section is empty.