STREAMS/UX for the HP 9000 Reference Manual
49
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Modifications to STREAMS/UX Utilities
unweldq
The utility unweldq disconnects two drivers' queues that were joined by
weldq:
int unweldq (d1_wq, d2_rq, d2_wq, d1_rq, func, arg, protect_q);
queue_t * d1_wq;
queue_t * d2_rq;
queue_t * d2_wq;
queue_t * d1_rq;
weld_fcn_t func;
weld_arg_t arg;
queue_t * protect_q;
d1_wq and d1_rq are one of the driver's write and read queues. d2_wq and
d2_rq are the second driver's queues. unweldq will set d1_wq->q_next and
d2_wq->q_next to zero. Also, it updates queue fields used for flow control
that are not visible to the STREAMS/UX programmer, and therefore cannot
be changed by the STREAMS/UX programmer.
unweldq returns to the caller before disconnecting the drivers. unweldq
requests that the STREAMS/UX weld daemon update the queues.
Note that if one end of a pipe-like stream created by weld is closed,
STREAMS/UX will automatically unweld the two drivers. unweldq does
not need to be called.
The weld daemon will call func with arg as an argument after it finishes the
request. protect_q specifies which queue the callback function can access
safely. See “STREAMS/UX Uniprocessor Synchronization” in this chapter
and “Writing MP Scalable Modules and Drivers” in Chapter 4 for a more
detailed discussion of protect_q.
If your driver does not need to be notified when the daemon finishes the weld
request, pass weldq zero for the func, arg, and protect_q parameters.
On successful completion, unweldq returns 0. Otherwise, it returns an errno
indicating the type of error that occurred. One of the following three values
will be returned:
• ENXIO indicates that the weld daemon is not running.
• EINVAL indicates that invalid queue arguments are present.
• EAGAIN means that no memory is available.