DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

phalloc(D3)


phalloc -- allocate and initialize a pollhead structure

Synopsis (Not in current DDI version)

   #include <sys/poll.h>
   #include <sys/kmem.h>
   #include <sys/ddi.h>
   

struct pollhead *phalloc(int flag);

Description

phalloc 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 does not sleep, but phalloc returns NULL if sufficient memory is not immediately available.

Arguments


flag
Specifies whether the caller is willing to sleep waiting for memory.

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 conforming drivers should only use pollhead structures that have been allocated and initialized using phalloc. Use of pollhead structures that have been obtained by any other means is prohibited on such systems.

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: 3, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp

References

chpoll(D2), phfree(D3)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005