NIO CommKit Host Interface Installation and System Administration Manual
6-17
Porting CommKit Applications To Release 4.x
Programmer-Level Compatibility
poll(2)
You can now use the poll system call with CommKit software STREAMS
devices. With earlier releases, your application had to either wait for data to
arrive (a synchronous poll) or rely on some implementation-specific trick,
such as a signal, to poll for data (an asynchronous poll). Release 3.2 of the
CommKit software, for example, provides the DIOCSIG ioctl to signal a
process when data has arrived.
With STREAMS, you can use the I_SETSIG ioctl with the poll system call
to eliminate implementation-dependent tricks. For more information, refer
to the manual page streamio(7) in the STREAMS programmer’s guide for
UNIX System V Release 4 and to the poll example later in this chapter.
close(2)
The close system call has changed the least, but may cause certain
applications difficulty if the timing required to close and proceed to the next
activity is critical. In STREAMS, the close system call waits up to 15
seconds for each module and driver to drain before the stream is dismantled
and the system call returns. If your application requires special timing
considerations, use O_NODELAY on the open system call. This causes the
close system call to return immediately, but may also cause other side effects
with the read and write system calls.
dk_flush changes the close processing for flushing queued transmit user data
on a data switch connection. flush_time may be specified to control how
long close will wait for data to drain to the data switch's remote endpoint as
one of the following.
The data drains when your application closes the fd, by means of close or
exit. When the queued data doesn’t drain or the remote endpoint disconnects
the circuit, close fails and returns an error to allow you to determine the
failure condition. This error return only occurs when dk_flush is called.
Refer to the dkflush(3X) manual page for the return values.
-1 Wait for all of the queued user data to drain.
0 Compute a time delay based on the queued user data to drain;
this assumes data drains at a rate of 10 bytes per second,
equivalent to a 110-baud printer.
> Wait the specified seconds for the queued user data to drain.