How to use Linux message queues?

Neven via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 14 08:38:57 PST 2014


I've tried importing core.sys.posix.sys.msg however I get the 
error that is doesn't exist.

I sort of solved the problem with:

extern (C) int msgget ( key_t key, int msgflg );
extern (C) int msgsnd ( int msqid, msgbuf *msgp, int msgsz, int 
msgflg );

struct msgbuf {
     long mtype;         /* type of message */
     int a;
     int b;
};

though this is ugly and I don't have useful constants located in 
C headers. I'm wondering is there a better way to utilize Linux 
message queue IPC in D?


More information about the Digitalmars-d-learn mailing list