esbbcall(D3DK) —
.IX \f4esbbcall\fP(D3DK)
NAME
esbbcall − call a function when an externally-supplied buffer can be allocated
SYNOPSIS
#include <sys/types.h>
#include <sys/stream.h>
toid_t esbbcall(int pri, void (∗func)(), long arg);
ARGUMENTS
priPriority of the esballoc(D3DK) allocation request (BPRI_LO, BPRI_MED, BPRI_HI, or BPRI_CONSOLE.)
funcFunction to be called when a buffer becomes available.
argArgument to the function to be called when a buffer becomes available.
DESCRIPTION
esbbcall, like bufcall(D3DK), serves as a timeout call of indeterminate length. If esballoc(D3DK) is unable to allocate a message block header and a data block header to go with its externally supplied data buffer, esbbcall can be used to schedule the routine func, to be called with the argument arg when memory becomes available.
When func runs, all interrupts from STREAMS devices will be blocked on the processor on which it is running. func will have no user context and may not call any function that sleeps.
RETURN VALUE
If successful, esbbcall returns a non-zero value that identifies the scheduling request. This non-zero identifier may be passed to unbufcall(D3DK) to cancel the request. If any failure occurs, esbbcall returns 0.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
Even when func is called, esballoc can still fail if another module or driver had allocated the memory before func was able to call allocb.
SEE ALSO
allocb(D3DK), bufcall(D3DK), esballoc(D3DK), itimeout(D3DK), unbufcall(D3DK)
DDI/DKI — STREAMS