SCREATE(2)
NAME
screate − create a new semaphore
SYNOPSIS
int screate(count)
int count;
DESCRIPTION
Screate creates a counting semaphore and initializes it to count. If successful, screate returns the integer identifier of the new semaphore. It returns SYSERR if no more semaphores can be allocated or if count is less than zero.
Semaphores are manipulated with WAIT(2) and SIGNAL(2) to synchronize processes. Waiting causes the semaphore count to be decremented; decrementing a semaphore count past zero causes a process to be blocked. Signaling a semaphore increases its count, freeing a blocked process if one is waiting.
SEE ALSO
scount(2), sdelete(2), signal(2), sreset(2), wait(2)
December 01, 1986 — Xinu Programmer’s Manual