【发布时间】:2021-01-22 16:55:08
【问题描述】:
我尝试在 Windows 10 的 linux 子系统上创建消息队列。 当我尝试使用此函数创建消息队列时:
queueId = msgget(*key, IPC_CREAT | IPC_EXCL | 0660);
if (queueId == -1)
{
if (errno == EEXIST)
{
queueId = msgget(*key, IPC_CREAT | 0660);
printf("Messege queue already exists, access acquired\n");
return;
}
else
{
printf("Couldn't create message queue. Process ended with error: %d\n", errno);
exit(EXIT_FAILURE);
}
}
else
{
printf("Message queue has been created with id: %d\n", queueId);
}
我收到错误编号 38,即 ENAMETOOLONG。在这种情况下我该怎么办?
【问题讨论】:
-
这是在 WSL2 上还是在原始 WSL 上?
-
@PiRocks 原创 WSL
-
你用的是什么名字?
-
@Shawn 叫什么名字?
标签: c linux windows-subsystem-for-linux