Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ phalloc(D3DK) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

poll(2)

phalloc(D3DK)  —  

.IX \f4phalloc\fP(D3DK)

NAME

phalloc − allocate a pollhead structure

SYNOPSIS

#include <sys/poll.h>
#include <sys/kmem.h>
struct pollhead ∗phalloc(int flag);

ARGUMENTS

flagIndicates whether caller should sleep for free space.  If flag is set to KM_SLEEP, the caller will sleep if necessary until memory is available.  If flag is set to KM_NOSLEEP, the caller will not sleep, but phalloc will return NULL if memory is not immediately available. 

DESCRIPTION

phalloc allocates the space for a pollhead structure.  It is used by a driver that supports polling to provide the pollhead structure for each minor device supported by the driver. 

RETURN VALUE

Upon successful completion, phalloc returns a pointer to the allocated pollhead structure.  If KM_NOSLEEP is specified and sufficient memory is not immediately available, phalloc returns a NULL pointer. 

LEVEL

Base only if flag is set to KM_SLEEP.  Base or interrupt if flag is set to KM_NOSLEEP. 

NOTES

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. 

SEE ALSO

chpoll(D2DK), phfree(D3DK), pollwakeup(D3DK), poll(2) in the Programmer’s Reference Manual

DDI/DKI

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026