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
259
Write Offset
A module or driver can send the stream head an M_SETOPTS message, telling the STREAM
head to put an offset in the beginning of the first data block in a message sent by a putmsg
call. STREAMS/UX will not put the offset into the data block if the amount of memory
required is greater than the page size.
select Modifications
STREAMS/UX supports the select system call for STREAMS devices. For more information about the select
system call, see the select (2) manpage provided with the HP-UX system.
The select system call does not provide as much information as poll. If select returns an event for a
STREAMS device, the program can call poll to get more information.
A select read event is returned if a poll event POLLRDNORM, POLLERR, POLLNVAL or POLLHUP exists on the
stream. In other words, a read event is returned for the following conditions:
• Normal message is waiting to be read
• Read error exists at the stream head
• Write error exists at the stream head
• Stream is linked under a multiplexor
• Hang-up has occurred
A select write event is returned if a poll event POLLOUT, POLLWRNORM, POLLERR, POLLNVAL, or POLLHUP exists
on the STREAM. This means that a write event is returned for the following conditions:
• Normal data can be written without blocking because of flow control
• Read error exists at the stream head
• Write error exists at the stream head
• Stream is linked under a multiplexor
• Hang-up has occurred
A select exception event is returned if a poll event POLLPRI or POLLRDBAND exists on the STREAM. More
specifically, an exception event is returned if a high-priority message or a banded message is waiting to be
read.
/dev/poll Interface
HP-UX offers the /dev/poll interface as an added feature and as alternate functionality to poll (2). It
provides an interface to the event port driver allowing a user to synchronously monitor a specific set of
conditions associated with the registered set of file descriptors. Access to /dev/poll is provided through the
open (2), write (2), and ioctl (2) system calls.
The /dev/poll event port provides functionality comparable to the select (2) and poll (2) system calls.
General operations supported by the event port driver are:
• Opening an event port
• Registering and deregistering file descriptors on an event port
• Polling registered file descriptors on an event port
• Retrieving registered poll conditions for a file descriptor