我正在尝试创建一个 POSIX 消息队列,但 mq_open() 始终返回 -1。这是我的代码。可能是什么原因?怎么理解?
mqd_t mq;
struct mq_attr attr;
mq = mq_open("/randomMq", (O_RDONLY | O_CREAT), 0666, &attr);
printf("%d\n",mq);
最佳答案
正如您现在通过检查 errno 发现的那样,它看起来像 neither System V messages nor POSIX message queues are currently implemented in the Windows Subsystem for Linux .
关于无法创建 posix 消息队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48963584/