unbufcall(D3DK) —
.IX \f4unbufcall\fP(D3DK)
NAME
unbufcall − cancel a pending bufcall request
SYNOPSIS
#include <sys/stream.h>
void unbufcall(toid_t id);
ARGUMENTS
idIdentifier returned from bufcall(D3DK) or esbbcall(D3DK).
DESCRIPTION
unbufcall cancels a pending bufcall or esbbcall request. The argument id is a non-zero identifier for the request to be canceled. id is returned from the bufcall or esbbcall function used to issue the request.
RETURN VALUE
None.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may not be held across calls to this function.
SEE ALSO
bufcall(D3DK), esbbcall(D3DK)
EXAMPLE
See bufcall for the other half of this example.
In the module close routine, the put(D2DK) and srv(D2DK) routines are disabled by calling qprocsoff(D3DK) (line 16). This will prevent any further bufcall or timeout requests from being issued by the service routine. If a bufcall request is pending (line 17), we cancel it (line 18). Otherwise, if a timeout request is pending (line 19), we cancel it (line 20). Then the m_type field of the module’s private data structure is set to 0, indicating no pending bufcall or timeout.
1 struct mod {
2toid_tm_id;
3charm_type;
4lock_t∗m_lock;
. . .
5 };
6 #define TIMEOUT1
7 #define BUFCALL2
. . .
8 modclose(q, flag, crp)
9queue_t ∗q;
10int flag;
11cred_t ∗crp;
12 {
13struct mod ∗modp;
14modp = (struct mod ∗)q->q_ptr;
15qprocsoff(q);
16if (modp->m_type == BUFCALL)
17unbufcall(modp->m_id);
18else if (modp->m_type == TIMEOUT)
19untimeout(modp->m_id);
20modp->m_type = 0;
. . .
.IX \f4unbufcall\fP(D3DK), example
.IX \f4untimeout\fP(D3DK), example
.IX \f4qprocsoff\fP(D3DK), example
DDI/DKI — STREAMS