SCOUNT(2)
NAME
scount − return the count associated with a semaphore
SYNOPSIS
int scount(sem)
int sem;
DESCRIPTION
Scount returns the current count associated with semaphore sem. A count of negative p means that there are p processes waiting on the semaphore; a count of positive p means that at most p more calls to WAIT(2) can occur before a process will be blocked (assuming no intervening sends occur).
SEE ALSO
screate(2), sdelete(2), signal(2), sreset(2), wait(2)
BUGS
In this version, there is no way to distinguish SYSERR from a legal semaphore count of −1.
December 01, 1986 — Xinu Programmer’s Manual