Recovers from a failure of the allocb utility.
#include <sys/stream.h>
int
bufcall(size, pri, func, arg)
uint size;
int pri;
void (* func)();
long arg;
The bufcall utility assists in the event of a block-allocation failure. If the allocb utility returns a null, indicating a message block is not currently available, the bufcall utility may be invoked.
The bufcall utility arranges for (*func)(arg) call to be made when a buffer of the number of bytes specified by the size parameter is available. The pri parameter is as described in the allocb utility. When the function specified by the func parameter is called, it has no user context. It cannot reference the u_area and must return without sleeping. The bufcall utility does not guarantee that the desired buffer will be available when the function specified by the func parameter is called since interrupt processing may acquire it.
On an unsuccessful return, the function specified by the func parameter will never be called. A failure indicates a temporary inability to allocate required internal data structures.
On multiprocessor systems, the function specified by the func parameter should be interrupt-safe. Otherwise, the STR_QSAFETY flag must be set when installing the module or driver with the str_install utility.
This utility is part of STREAMS Kernel Extensions.
size | Specifies the number of bytes needed. |
pri | Specifies the relative importance of the allocated blocks to the module. The possible values are: |
func | Specifies the function to be called. |
arg | Specifies an argument passed to the function. |
The bufcall utility returns a value of 1 when the request is successfully recorded. Otherwise, it returns a value of 0.
The allocb utility, unbufcall utility, mi_bufcall utility.
List of Streams Programming References and Understanding STREAMS Messages in AIX 5L Version 5.2 Communications Programming Concepts.
Understanding STREAMS Synchronization in AIX 5L Version 5.2 Communications Programming Concepts.