STREAMS-UX Programmer's Guide (February 2007)
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Modifications to STREAMS/UX Utilities
Appendix E
264
The compiler options to turn on deadlock checking for HP-UX are different than those documented in the
SVR4.2 Driver manual. The entire HP-UX kernel and the module or driver must be compiled with
SEMAPHORE_DEBUG to enable deadlock checking. According to the SVR4.2 Driver manual, the
min_pl
parameter can be ignored by implementations which do not need to raise the priority level. The HP-UX
STREAMS LOCK_ALLOC ignores it.
putctl2
STREAMS/UX also provides the additional utility called putctl2. This utility can be used to send a control
message with a two-byte parameter to a queue. For example, putctl2 can send the new style of an M_ERROR
message, which is two bytes long, to the specified queue:
int putctl2(queue_t *q, int type, int p1, int p2);
where,
q The queue to which the message is sent
type The message type
p1,p2 Two bytes of data in the message.
The putctl2 utility ensures that the type is not a data type. The utility also allocates a message block, fills in
the data, and calls the put procedure of the specified queue.
The putctl2 utility returns 0 if the type is M_DATA, M_PROTO or M_PCPROTO, or if a message block cannot be
allocated. putctl2 utility returns 1 if it completes successfully.
putnextctl2
STREAMS/UX provides an additional utility putnextctl2. This utility can be used to send a control message
with a two-byte parameter to the next queue in a stream. For example, putnextctl2 can send the new style
of an M_ERROR message, which is two bytes long, to the next queue in a stream:
int putnextctl2(queue_t *q, int type, int p1, int p2);
where,
q The queue from which the message is sent to q->q_next
type is the message type
p1,p2 Two bytes of data in the message.
The putnextctl2 utility ensures that the type is not a data type. The utility also allocates a message block,
fills in the data, and calls the put procedure of q->q_next.
The putnextctl2 utility returns 0 if the type is M_DATA, M_PROTO, or M_PCPROTO, or if a message block cannot
be allocated. putnextctl2 utility returns 1 if it completes successfully.
qprocson and qprocsoff
SVR4 MPSTREAMS provides qprocson and qprocsoff, which on a multiprocessor system allows a module’s
put and service procedures to run concurrently with open and close. STREAMS/UX does not allow this
parallelism. A module’s or driver’s put and service procedures cannot run at the same time as the open or
close. Although STREAMS/UX does not run the put or service procedure in parallel with the open or close, it
does queue any requests to run the put or service procedure. STREAMS/UX will process these when open
finishes. Also, if open or close sleeps, STREAMS/UX can run the put and service procedures while open or
close are sleeping. However, a put or service procedure cannot do the wakeup on a sleeping open or close.
STREAMS/UX provides stubs which are no-ops for qprocson and qprocsoff to make porting easier.