phalloc(D3)phalloc(D3)NAMEphalloc - allocate and initialize a pollhead structure
SYNOPSIS
#include <sys/poll.h>
#include <sys/kmem.h>
#include <sys/ddi.h>
struct pollhead *phalloc(int flag);
Arguments
flag Specifies whether the caller is willing to sleep waiting for
memory.
DESCRIPTIONphalloc allocates and initializes a pollhead structure for use by non-
STREAMS character drivers that wish to support polling. 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 phalloc will return NULL if sufficient memory is not immediately
available.
Return Values
On success, phalloc returns a pointer to the newly allocated pollhead
structure. If KM_NOSLEEP is specified and sufficient memory is not
immediately available, phalloc returns a NULL pointer.
USAGE
On systems where the phalloc function is available, DDI/DKI conforming
drivers should only use pollhead structures which have been allocated and
initialized using phalloc. Use of pollhead structures which have been
obtained by any other means is prohibited on such systems.
Level
Base only if flag is set to KM_SLEEP.
Initialization, Base or Interrupt if flag is set to KM_NOSLEEP.
Synchronization Constraints
May sleep if flag is set to KM_SLEEP.
Driver-defined basic locks and read/write locks may be held across calls
to this function if flag is KM_NOSLEEP but may not be held if flag is
KM_SLEEP.
Driver-defined sleep locks may be held across calls to this function
regardless of the value of flag.
REFERENCESpoll(D2), phfree(D3)
Page 1