sem_open(3) Library Functions Manual sem_open(3) sem_open - LIBRARY POSIX threads library (libpthread, -lpthread) #include /* O_* */ #include /* mode */ #include sem_t *sem_open(const char *name, int oflag); sem_t *sem_open(const char *name, int oflag, mode_t mode, unsigned int value); sem_open() POSIX . name. name sem_overview(7). oflag , ( ). oflag O_CREAT, , . (ID ) ID . (ID ) ID . oflag O_CREAT O_EXCL name , . oflag O_CREAT, . mode , open(2) ( ). . , . value . O_CREAT name , mode value . sem_open() ; , . sem_open() SEM_FAILED, errno . EACCES , . EEXIST oflag O_CREAT O_EXCL, name . EINVAL value SEM_VALUE_MAX. EINVAL name <>, . EMFILE . ENAMETOOLONG name. ENFILE . ENOENT oflag O_CREAT name ; O_CREAT, name . ENOMEM . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |sem_open() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. . sem_close(3), sem_getvalue(3), sem_post(3), sem_unlink(3), sem_wait(3), sem_overview(7) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . sem_open(3)