1

I am trying to create a POSIX message queue but mq_open() returns -1 all the time. Here is my code. What might be the reason? How can I understand?

mqd_t mq;
struct mq_attr attr;
mq = mq_open("/randomMq", (O_RDONLY | O_CREAT), 0666, &attr);
printf("%d\n",mq);
2
  • 3
    "On error, mq_open() returns (mqd_t) -1, with errno set to indicate the error.", says the manpage. So what's the value of errno? Perhaps try a quick perror... Commented Feb 24, 2018 at 13:54
  • 1
    Thank you. errno returns "Function not implemented". I think that means posix queues are not implemented on Bash on Ubuntu on Windows subsystem which I am using. Commented Feb 24, 2018 at 14:19

1 Answer 1

3

As you've now discovered by checking errno, it seems like neither System V messages nor POSIX message queues are currently implemented in the Windows Subsystem for Linux.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.