Establishes an uni-directional connection between STREAMS queues.
#include <sys/stream.h>
int weldq (q1, q2, q3, q4, func, arg, protect_q) queue_t *q1; queue_t *q2; queue_t *q3; queue_t *q4; weld_fcn_t func; weld_arg_t arg; queue_t *protect_q;
The weldq utility establishes an uni-directionnal connection (weld connection) between two STREAMS queues (q1 and q2). The weldq utility can be used to weld two pairs of queues in one call (q1 and q2, q3 and q4).
The welding operation is performed by changing the first queue's q_next pointer to point to the second queue. The weldq utility does not actually perform the operation. Instead, it creates a welding request which STREAMS performs asynchronously. STREAMS acquires the appropriate synchronization queues before performing the operation.
Callers that need to know when the welding operation has actually taken place should specify a callback function (func parameter) when calling the weldq utility. If the caller also specifies a synchronization queue (protect_q parameter), STREAMS acquires the synchronization associated with that queue when calling func. If the callback function is not a protected STREAMS utility, such as the qenable utility, the caller should always specify a protect_q parameter. The caller can also use this parameter to synchronize callbacks with protected STREAMS utilities.
Note: The stream.h header file must be the last included header file of each source file using the stream library.
Upon successful completion, 0 (zero) is returned. Otherwise, an error code is returned.
The weldq utility fails if the following is true:
EAGAIN | The weld record could not be allocated. The caller may try again. |
EINVAL | One or more parameters are not valid. |
ENXIO | The weld mechanism is not installed. |
This utility is part of STREAMS Kernel Extensions.
List of Streams Programming References in AIX Communications Programming Concepts.
STREAMS Overview in AIX Communications Programming Concepts.
Welding Mechanism in AIX Communications Programming Concepts.
The unweldq utility.