STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
237
NAME
weldq () – Establish connections between two drivers’ queues.
SYNOPSIS
#include <sys/stream.h>
int weldq (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);
PARAMETERS
d1_wq
,
d1_rq
First drivers’ write and read queues.
d2_wq
,
d2_rq
Second drivers’ write and read queues
func
and
arg
Optional callback function pointer and argument for callback.
protect_q
Optional synchronization queue to be acquired when func is executed.
DESCRIPTION
weldq() sets d1_wq->q_next to point to d2_rq and d2_wq->q_next to point to d1_rq. It sends an
asynchronous request to the weld daemon to update relevant queue parameters and returns back to the caller
without waiting for the completion of that request. If the
func
and protect_q are specified, the weld daemon
acquires the synchronization queue before executing the func.
However, if the caller does not need to be notified by the weld daemon, the parameters
func
,
arg
, and
protect_q
can be set to 0.
RETURN VALUES
unweldq() returns 0 on success and one of the error codes upon failure.
ENXIO Weld mechanism is not available.
EINVAL Invalid queue arguments.
EAGAIN Could not allocate weld record.
CONSTRAINTS
weldq() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order can
be held across this call.