sem_getvalue(3) Library Functions Manual sem_getvalue(3) sem_getvalue - LIBRARY POSIX threads library (libpthread, -lpthread) #include int sem_getvalue(sem_t *restrict sem, int *restrict sval); sem_getvalue() , sem, , sval. sem_wait(3), POSIX.1 sval: 0 , sem_wait(3). Linux . sem_getvalue() 0; -1, errno . EINVAL sem is not a valid semaphore. (The glibc implementation currently does not check whether sem is valid.) attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |sem_getvalue() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. sem_getvalue(). . sem_post(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_getvalue(3)