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

esbbcall(D3str)


esbbcall -- call a function when an externally-supplied buffer can be allocated

Synopsis (Not in ODDI)

   #include <sys/types.h>
   #include <sys/stream.h>
   #include <sys/ddi.h>
   

toid_t esbbcall(int pri, void (*func)(), long arg);

Description

If esballoc(D3str) is unable to allocate a message block header and a data block header to go with its externally supplied data buffer, the function esbbcall can be used to schedule the routine func, to be called with the argument arg when memory becomes available. esbbcall, like bufcall(D3str), serves, in effect, as a timeout call of indeterminate length.

Arguments


pri
Priority of the esballoc(D3str) allocation request, which is a hint to the allocator indicating how badly the buffer is needed:


BPRI_LO
Used for normal data allocations.

BPRI_MED
Used for other non-critical allocations.

BPRI_HI
Used for allocations that absolutely must succeed, although success is not guaranteed.

Some implementations may choose to ignore this argument.


func
Function to be called when a buffer becomes available.

arg
Argument to the function to be called when a buffer becomes available.

Return values

On success, esbbcall returns a non-zero value that identifies the scheduling request. On failure, esbbcall returns 0.

Usage

When func runs, all interrupts from STREAMS devices are blocked. On multiprocessor systems, the interrupts will be blocked only on the processor on which func is running. func has no user context and may not call any function that blocks.

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.

The non-zero identifier returned by esballoc may be passed to unbufcall(D3str) to cancel the request.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

Differences between versions

The esbbcall function is currently defined to return a toid_t data type. In earlier releases, it returned an int.

SCO OpenServer 5 ODDI compatibility

SCO OpenServer 5 ODDI drivers use the bufcall(D3str) fuction to recover from esballoc(D3str) allocation failures.

References

allocb(D3str), bufcall(D3str), esballoc(D3str), itimeout(D3), timeout(D3), unbufcall(D3str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005