HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
s
stream(2) stream(2)
A write to a STREAMS device may fail for one or more of the following STREAMS-specific conditions:
[EAGAIN] The
O_NONBLOCK flag is set, and the stream cannot accept write() data because it
is flow controlled.
[EINVAL] The
write() function attempts to write to a stream that is linked below a multi-
plexor.
[ENXIO] A hangup occurs on a stream while the
write() function is writing to the stream.
[ERANGE] The nbytes parameter is not within the allowable range.
The
write() system call will also fail if an error message has been received at the stream head of the
stream to which the write() function is attempting to write. In this case, the function returns with
errno set to the value included in the error message.
Ioctl Enhancements
Refer to the streamio(7) man page for a description of STREAMS
ioctl() functionality.
Select Enhancements
The
select() system call checks the status of STREAMS devices. select() does not provide as much
information for STREAMS devices as poll(). A program calls select() so that it can wait for events
on both STREAMS and non-STREAMS devices. If select() returns an event for a STREAMS device,
the program can call poll() to get more information. Refer to the poll(2) man page for more information
about poll().
select() returns a read event if a poll() POLLIN, POLLERR, POLLNVAL or POLLHUP event exists
on the stream. In other words,
select() returns a read event if a normal or priority band message is
waiting to be read, if a read error exists at the stream head, if a write error exists at the stream head, if
the stream is linked under a multiplexor, or if a hang-up has occurred.
select() returns a write event if a poll() POLLOUT, POLLWRNORM , POLLERR,orPOLLNVAL
event exists on the stream. This means that select() returns a write event if normal data can be writ-
ten without blocking because of flow control, a read error exists at the stream head, a write error exists at
the stream head, or the stream is linked under a multiplexor.
select() returns an exception event if a poll() POLLPRI event exists on the stream. More
specifically, select() returns an exception event if a high-priority message is waiting to be read.
Signal Enhancements
A new signal, SIGPOLL, has been added for STREAMS. Processes register to receive a
SIGPOLL signal
for events that occur on a STREAMS device (see the signal(2) man page and
I_SETSIG
in the streamio(7)
man page). The default action is to ignore the signal, not to terminate the process.
SEE ALSO
close(2), fcntl(2), getmsg(2), open(2), poll(2), putmsg(2), read(2), signal(2), select(2), write(2), streamio(7),
and STREAMS/UX for HP9000 Reference Manual.
464 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007