开发者论坛
标题:
OpenHarmony linux内核使用信号量问题
[打印本页]
作者:
yeyao
时间:
2024-7-12 10:47
标题:
OpenHarmony linux内核使用信号量问题
### 【问题描述】
linux内核使用sem_open创建信号量返回错误 No such file or directory 这是为什么呢
```
sem_t *sem_main = sem_open("/sem_main", O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH , 0666);
if(sem_main == SEM_FAILED){
perror("主进程信号量创建失败,请重启机器");
exit(110);
}
```
欢迎光临 开发者论坛 (https://oh-test.qingcheng100.cn/)
Powered by Discuz! X3.5