mi_bufcall Utility

Purpose

Provides a reliable alternative to the bufcall utility.

Syntax

#include <pse/mi.h>
#include <sys/stream.h>

void mi_bufcall ( Queue,  Size,  Priority)
queue_t *Queue;
int Size;
int Priortity;

Description

The mi_bufcall utility provides a reliable alternative to the bufcall utility. The standard STREAMS bufcall utility is intended to be called when the allocb utility is unable to allocate a block for a message, and invokes a specified callback function (typically the qenable utility) with a given queue when a large enough block becomes available. This can cause system problems if the stream closes so that the queue becomes invalid before the callback function is invoked.

The mi_bufcall utility is a reliable alternative, as the queue is not deallocated until the call is complete. This utility uses the standard bufcall mechanism with its own internal callback routine. The callback routine either invokes the qenable utility with the specified Queue parameter, or simply deallocates the instance data associated with the stream if the queue has already been closed.

The mi_bufcall utility is part of STREAMS kernel extensions.

Note: The stream.h header file must be the last included header file of each source file using the stream library.

Parameters

Item Description
Queue Specifies the queue which is to be passed to the qenable utility.
Size Specifies the required buffer size.
Priority Specifies the priority as used by the standard STREAMS bufcall mechanism.