Sample Header Ad - 728x90

How to open an existing named semaphore?

0 votes
1 answer
3764 views
Obviously O_CREAT and O_EXCL are not required when opening an existing semaphore. O_CREAT is required when creating a new semaphore. O_EXCL is only meaningful when OR-ing with O_CREAT, specifying that if a semaphore with the given name already exists, then an error is returned. Linux manual page for sem_open said that > Definitions of the flags values can be obtained by including but I did not find any flag in fcntl.h that told me how to open an existing semaphore.
Asked by Andy Lin (121 rep)
May 29, 2021, 04:39 PM
Last activity: May 29, 2021, 06:24 PM