initnsema(D3X)

initnsema - initialize a synchronizing semaphore to a given value

As shipped in IRIX 6.5.15. Unchanged since IRIX 6.5.

NAME
     initnsema - initialize a synchronizing semaphore to a given value

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

     initnsema(sema_t *semap, int val, char *name);

DESCRIPTION
     initnsema initializes an IRIX synchronizing semaphore (a structure of
     type sema_t). Use synchronizing semaphores to synchronize multiple
     processes. You must allocate a semaphore before you can use it in a
     semaphore operation, such as psema or vsema. You can declare semaphores
     in line by using the sema_t type, or you can allocate them dynamically by
     using the kernel memory allocator, kern_malloc(D3X). In the case of an
     already allocated semaphore struct, initsema fills it.

     The val parameter expects the initial value to which you want to set the
     semaphore. The name parameter of initnsema expects a pointer to an eight
     character string that contains the name you want to assign to the
     semaphore. This name may be used by debugging utilities.

   Return Values
     None

   See Also
     initnsema_mutex(D3X), cpsema(D3X), cvsema(D3X), psema(D3X), vsema(D3X),
     sleep(D3), vpsema(D3X), SLEEP_ALLOC(D3), SLEEP_DEALLOC(D3)