valusema(D3X)

valusema - return the value associated with a semaphore

Showing IRIX 6.5.30 (default release). Unchanged since IRIX 6.5.

NAME
     valusema - return the value associated with a semaphore

SYNOPSIS
     #include "sys/types.h"
     #include "sys/sema.h"

     valusema (sema_t *semap);

DESCRIPTION
     valusema returns a snapshot of the semaphore value associated with the
     semaphore pointed to by semap. Because it performs no work, valusema is
     primarily used for assertions.

     Because the semaphore value can change immediately after the call, you
     cannot use valusema for conditional semaphore operations. For situations
     where you need to do this, use cpsema(D3X) and cvsema(D3X).

     To initialize a semaphore, call initnsema(D3X) or initnsema_mutex(D3X).

   Return Values
     The returned value of this function is the value of the semaphore pointed
     to by the semap parameter. Of course, if you give this function a bogus
     semaphore pointer, there is no telling what the function returns.

   See Also
     ASSERT(D3)