Skip to content
/ ipc Public
forked from siadat/ipc

Go wrapper for System V message queue

Notifications You must be signed in to change notification settings

WeirdBob/ipc

 
 

Repository files navigation

System V message queue IPC functions

Wrapper functions for System V Message Queue IPC.

GoDoc Build Status

Example

package main

import (
	"log"
	"syscall"

	"github.com/siadat/ipc"
)

func main() {
	key, err := ipc.Ftok("/dev/null", 42)
	if err != nil {
		panic(err)
	}

	qid, err := ipc.Msgget(key, ipc.IPC_CREAT|ipc.IPC_EXCL|0600)
	if err == syscall.EEXIST {
		log.Fatalf("queue(key=0x%x) exists", key)
	}
	if err != nil {
		log.Fatal(err)
	}

	msg := &ipc.Msgbuf{Mtype: 12, Mtext: []byte("message")}
	err = ipc.Msgsnd(qid, msg, 0)
	if err != nil {
		log.Fatal(err)
	}
}

About

Go wrapper for System V message queue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 88.3%
  • Makefile 4.2%
  • Shell 4.1%
  • C 3.4%