STREAMS-UX Programmer's Guide (February 2007)
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Changes to STREAMS/UX System Calls
Appendix E
258
NOTE 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.
pipe Modifications
STREAMS/UX supports STREAMS-based pipes as an optional feature. STREAMS/UX’s STREAMS-based
pipes behave as described in the UNIX SVR4.2 Operating System API Reference and the UNIX System V
Release 4 Programmer’s Guide: STREAMS.
By default, pipes created by the pipe (2) system call are not STREAMS-based. In order to get
STREAMS-based pipes, the /stand/system file must have the pipemod and pipedev module and driver
configured, and the tunable parameter streampipes must be set to 1 (one).
When STREAMS/UX is installed, the /stand/system file is modified to include pipemod and pipedev, but
streampipes is set to zero by default. The kernel must be regenerated and the system rebooted if the setting of
streampipes to non-zero is to take effect. In other words, adb’ing the running system to turn streampipes on
will have no effect on the type of pipes created by pipe (2). Once the kernel is regenerated and rebooted, all
pipe (2) pipes on the system will be STREAMS-based. However, FIFOs will not be STREAMS-based.
STREAMS/UX does not support STREAMS-based FIFOs.
The STREAMS/UX device pipedev is only for internal STREAMS/UX use in implementing STREAMS-based
pipes. Opening a device file with pipedev’s major number will not result in a STREAMS-based pipe, or even a
properly functioning stream. STREAMS-based pipes must be created using the pipe (2) system call.
The PIPE_BUF is a pathname variable value, and SVID, XPG4, POSIX, etc. define it as the maximum number
of bytes that is guaranteed to be written atomically. To obtain the correct value of PIPE_BUF, use fpathconf()
(see pathconf()). For STREAMS-based pipes, the value of PIPE_BUF depends on the configurable parameter
STRMSGSZ (by default, 8KB). For example, PIPE_BUF is set to 4KB if STRMSGSZ is 4KB, 8KB if STRMSGSZ is
8KB, and 16KB if STRMSGSZ is 16KB. There is one exception. If STRMSGSZ is set to 0, then PIPE_BUF for
STREAMS/UX pipes is set to 8KB.
putmsg and putpmsg Modifications
Maximum and Minimum Data Buffer Size:
The size of the user’s data buffer must be within the minimum and maximum packet size
range specified in the topmost STREAM module’s streamtab. It must also be less than or
equal to STRMSGSZ. If the number of bytes to transfer is not in this range, ERANGE will be
returned.
Maximum and Minimum Control Buffer Size:
The size of the user’s control buffer must be less than or equal to both STRCTLSZ and
STRMSGSZ. If STRCTLSZ is less than or equal to zero, the page size is used instead of
STRCTLSZ for this check.
Data Buffer Segmentation
The user’s data buffer may be sent in multiple data blocks chained together to form a
message. The maximum number of bytes, including the write offset, that can be sent in one
data block is equal to the page size.