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);
Enes Keles
  • 141
  • 1
  • 15
  • 3
    "On error, mq_open() returns (mqd_t) -1, **with errno set to indicate the error**.", says the [manpage](http://man7.org/linux/man-pages/man2/mq_open.2.html). So what's the [value of errno](https://stackoverflow.com/a/46014661/300836)? Perhaps try a quick [perror](https://stackoverflow.com/questions/503878/how-to-know-what-the-errno-means)... – Matt Gibson Feb 24 '18 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. – Enes Keles Feb 24 '18 at 14:19

1 Answers1

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.

Matt Gibson
  • 37,886
  • 9
  • 99
  • 128