STREAMS-UX Programmer's Guide (February 2007)
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Changes to STREAMS/UX Data Structures
Appendix E
273
HP-UX Changes to STREAMS/UX Data Structures
STREAMS/UX data structures are almost identical to those described in the SVR4.2 Driver manual.
STREAMS/UX places additional restrictions on how some of these structures can be accessed. STREAMS/UX
data structures that differ from the descriptions in the SVR4.2 Driver manual are described here. Data
structures identical to those described in the SVR4.2 Driver manual are not listed here.
STREAMS/UX data structures contain some declarations for fields used by STREAMS/UX internally that are
not visible to the STREAMS/UX programmer. The programmer will not be affected by these fields except that
the sizeof function will return a larger value.
Message Data Structures
These structures are slightly different from the ones in the SVR4.2 Driver manual.
msgb defined in <sys/stream.h>
The msgb structure contains MSG_KERNEL_FIELDS, which defines fields used internally by
STREAMS/UX.
iocblk defined in <sys/stream.h>
The ioc_count is defined to be a member of a union.
copyreq defined in <sys/stream.h>
The cq_addr is defined to be a member of a union.
copyresp defined in <sys/stream.h>
The cp_rval is defined to be a member of a union.
Queue Data Structure
The queue structure is slightly different from the one described in the SVR4.2 Driver manual. The structure
is defined in the file <sys/stream.h>. It contains an additional field QUEUE_KERNEL_FIELDS which defines
fields used internally by STREAMS/UX.The multiplexor ID number returned by I_LINK and I_PLINK is
opaque to the user and not a small integer such as 0, 1, 2, 3.
STREAMS/UX Data Structure Restrictions
STREAMS/UX has the same restrictions as those described in the Kernel Data Structure chapter of the
SVR4.2 Driver manual. Also, STREAMS/UX limits user written functions where users can access the queue
structure directly. A queue’s open, close, put, or service routine can manipulate the queue structure as
specified by SVR4.2. On a uniprocessor system, a queue’s entry points can access the other queue in the queue
pair in the same way that they can access their own queue. On a multiprocessor system, a queue’s entry
points can manipulate queues belonging to entities with which they can share data. They can manipulate the
queues in the same way that they can manipulate their own queue.
It is difficult to program other functions (besides those described) to access the queue structure directly,
especially on multiprocessor systems. If a queue’s entry points access queues other than those described
previously, or if non-STREAMS/UX software processes data in a STREAMS/UX queue, use the streams_put
utility to manipulate the queues safely. streams_put is described in the “HP-UX Modifications to
STREAMS/UX Utilities” section of this appendix.