I'm trying to write code using the mqueue library. I'm working on UNIX (solaris), but I can't get me code to run at all. This is a snippit of what I have..
#define PMODE 0666
int main()
{
int i;
mqd_t mqfd;
struct mq_attr attr;
int open_flags = 0;
attr.mq_maxmsg = 20;
attr.mq_msgsize = 30;
attr.mq_flags = 0;
open_flags = O_RDONLY|O_CREAT
mqfd = mq_open("myque",open_flags,PMODE,&attr);
if (mqfd ==(mqd_t)-1)
{
perror("mq_open failure from main"
exit(0);
};
/* more ....*/
}
It compiles, and I know myque doesn't exist. I get an 'invalid argument' error. What am I doing wrong?
Thanks!
#define PMODE 0666
int main()
{
int i;
mqd_t mqfd;
struct mq_attr attr;
int open_flags = 0;
attr.mq_maxmsg = 20;
attr.mq_msgsize = 30;
attr.mq_flags = 0;
open_flags = O_RDONLY|O_CREAT
mqfd = mq_open("myque",open_flags,PMODE,&attr);
if (mqfd ==(mqd_t)-1)
{
perror("mq_open failure from main"
exit(0);
};
/* more ....*/
}
It compiles, and I know myque doesn't exist. I get an 'invalid argument' error. What am I doing wrong?
Thanks!