SVR5
SV_ALLOC(D3)
SV_ALLOC --
allocate and initialize a synchronization variable
Synopsis
#include <sys/kmem.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
sv_t *SV_ALLOC(int flag);
Description
SV_ALLOC dynamically allocates and initializes an instance of a
synchronization variable.
If flag is set to KM_SLEEP, the caller will sleep if
necessary until sufficient memory is available.
If flag is set to KM_NOSLEEP, the caller will not sleep,
but SV_ALLOC will return NULL if sufficient memory is not
immediately available.
Arguments
flag-
Specifies whether the caller is willing to sleep waiting for memory.
Return values
Upon successful completion, SV_ALLOC returns a pointer to the newly
allocated synchronization variable.
If KM_NOSLEEP is specified and sufficient memory is not immediately
available, SV_ALLOC returns a NULL pointer.
Usage
Context and synchronization
If flag is set to KM_NOSLEEP,
non-blockable, initialization, or interrupt
context.
If flag is set to KM_SLEEP,
user
context.
Hardware applicability
All
Version applicability
ddi:
5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
References
SV_BROADCAST(D3),
SV_DEALLOC(D3),
SV_SIGNAL(D3),
SV_WAIT(D3),
SV_WAIT_SIG(D3)
``Synchronization variables'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005