Does redhatrelease4 not support semaphores shared by processes?
Source: Internet
Author: User
Does redhatrelease4 not support semaphores shared by processes? -- Linux general technology-Linux technology and application information. For details, refer to the following section. The version is redhat Enterprise Linux AS release 4. You want to use sem_init to initialize the semaphore for sharing among multiple processes. But man sem_init looked at it and said:
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.
That is to say, the system does not support multi-process shared semaphores,
But I tried int ret = sem_init (& sem, 1, 1 );
Check that the returned value is 0, not ENOSYS. ENOSYS corresponds to 38.
I don't know if the man manual corresponds to the system version, or is there a problem with my usage?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service