ipc
ipc copied to clipboard
regarding key and qid
is key or message queue id (qid) <== this going to be different if i ran the program for a long time (e.g. forever) coz i would like to init once instead of going to get the msqid all the time.
will it change during the runtime of the program? otherwise i just init as a variable and use everywhere for the duration of the daemon program
key, err := ipc.Ftok(ftokpath, ftokid)
if err != nil {
log.Fatal(err)
}
var qid uint
switch os.Args[1] {
case "s", "r":
qid, err = ipc.Msgget(key, ipc.IPC_CREAT|perm)