The probelm is that if you run mq_open with O_CREAT, it requires two more arguments:
mq_open(name, O_FLAGS, mode, mq_attr);
where mode is your standard S_IWUSR, S_IRUSR, etc. from sys/stat.h and mq_attr is a struct mq_attr with the number of messages and message size specified.
If you want to use the defaults, you can pass NULL for the last argument.
See mqueue.h for members of mq_attr.
The name of your mqueue must also follow the convention of one single "/" followed by the name with no other "/"s in the name.
You have no option of where the mqueue is created in the filesystem.
It will always be created in /dev/mqueue and you must create that directory and mount the mqueue filesystem there as well.
Also note that the flags member of mq_attr is ignored by mq_open and that flags is the ONLY member of mq_attr used by mq_setattr().
Last edited by lavaman; 11-04-2005 at 01:13 PM.
|