-
Notifications
You must be signed in to change notification settings - Fork 3
/
msg.go
38 lines (30 loc) · 1.05 KB
/
msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2020 Meng Huang ([email protected])
// This package is licensed under a MIT license that can be found in the LICENSE file.
package ipc
import (
"github.com/hslam/msg"
)
// Msgget calls the msgget system call.
func Msgget(key int, msgflg int) (int, error) {
return msg.Get(key, msgflg)
}
// Msgsnd calls the msgsnd system call.
func Msgsnd(msgid int, msgp uintptr, msgsz int, msgflg int) error {
return msg.Snd(msgid, msgp, msgsz, msgflg)
}
// Msgrcv calls the msgrcv system call.
func Msgrcv(msgid int, msgp uintptr, msgsz int, msgtyp uint, msgflg int) (int, error) {
return msg.Rcv(msgid, msgp, msgsz, msgtyp, msgflg)
}
// Msgsend calls the msgsnd system call.
func Msgsend(msgid int, msgType uint, msgText []byte, flags int) error {
return msg.Send(msgid, msgType, msgText, flags)
}
// Msgreceive calls the msgrcv system call.
func Msgreceive(msgid int, msgType uint, flags int) ([]byte, error) {
return msg.Receive(msgid, msgType, flags)
}
// Msgrm removes the shm with the given id.
func Msgrm(msgid int) error {
return msg.Remove(msgid)
}