红联Linux门户
Linux帮助

redhat release 4不支持进程共享的信号量吗?

发布时间:2012-05-28 12:59:24来源:红联作者:zjwoody
版本是redhat Enterprise Linux AS release 4,想使用sem_init初始化信号量供多进程间共享,但是man sem_init看了一下,其中说到:
The pshared argument indicates whether the semaphore is local to the current process ( pshared is zero) or is to be shared between several processes ( pshared is not zero). Linux-Threads currently does not support process-shared semaphores, thus sem_init always returns with error ENOSYS if pshared is not zero.
就是说本系统还不支持多进程共享信号量,
但是我试了一下int ret = sem_init(&sem, 1, 1);
检查返回值为0,并不是ENOSYS,ENOSYS对应38
不知道man手册是不是跟系统版本对应的,还是我的使用方式有问题?
文章评论

共有 0 条评论