DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
STREAMS polling and multiplexing

Asynchronous input/output

The poll system call enables a user to monitor multiple Streams in a synchronous fashion. The poll call normally blocks until an event occurs on any of the polled file descriptors. In some applications, however, it is desirable to process incoming data asynchronously. For example, an application may want to do some local processing and be interrupted when a pending event occurs. Some time-critical applications cannot afford to block, but must have immediate indication of success or failure.

The I_SETSIG ioctl call (see streamio(M)) is used to request that a ``SIGPOLL'' signal be sent to a user process when a specific event occurs. Listed below are events for the ioctl I_SETSIG. These are similar to those described for poll.


S_INPUT
A message other than an M_PCPROTO is at the front of the Stream head read queue. This event is maintained for compatibility with the previous releases of the UNIX System V.

S_RDNORM
A normal (nonpriority) message is at the front of the Stream head read queue.

S_RDBAND
A priority message (band > 0) is at the front of the Stream head read queue.

S_HIPRI
A high-priority message (M_PCPROTO) is present at the front of the Stream head read queue.

S_OUTPUT
A write queue for normal data (priority band = 0) is no longer full (not flow controlled). This notifies a user that there is room on the queue for sending or writing normal data downstream.

S_WRNORM
The same as S_OUTPUT.

S_WRBAND
A priority band greater than 0 of a queue downstream exists and is writable. This notifies a user that there is room on the queue for sending or writing priority data downstream.

S_MSG
An M_SIG or M_PCSIG message containing the ``SIGPOLL'' flag has reached the front of Stream head read queue.

S_ERROR
An M_ERROR message reaches the Stream head.

S_HANGUP
An M_HANGUP message reaches the Stream head.

S_BANDURG
When used with S_RDBAND, SIGURG is generated instead ``SIGPOLL'' when a priority message reaches the front of the Stream head read queue.

S_INPUT, S_RDNORM, S_RDBAND, and S_HIPRI are set even if the message is of zero length. A user process may choose to handle only high-priority messages by setting the arg to S_HIPRI.


Next topic: Signals
Previous topic: Synchronous input/output

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005