hslam_ipc/msg.go

29 lines
723 B
Go
Raw Normal View History

2020-11-29 04:42:18 +08:00
// Copyright (c) 2020 Meng Huang (mhboy@outlook.com)
// 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.
2020-11-30 18:20:17 +08:00
func Msgget(key int, msgflg int) (int, error) {
2020-11-29 04:42:18 +08:00
return msg.Get(key, msgflg)
}
// Msgsnd calls the msgsnd system call.
2020-11-30 18:20:17 +08:00
func Msgsnd(msgid int, msgType uint, msgText []byte, flags int) error {
2020-11-29 04:42:18 +08:00
return msg.Snd(msgid, msgType, msgText, flags)
}
// Msgrcv calls the msgrcv system call.
2020-11-30 18:20:17 +08:00
func Msgrcv(msgid int, msgType uint, flags int) ([]byte, error) {
2020-11-29 04:42:18 +08:00
return msg.Rcv(msgid, msgType, flags)
}
// Msgrm removes the shm with the given id.
2020-11-30 18:20:17 +08:00
func Msgrm(msgid int) error {
2020-11-29 04:42:18 +08:00
return msg.Remove(msgid)
}