[comp.unix.wizards] exceptfds in select

garzione@convex.com (Michael Garzione) (03/23/90)

The form of select(2) is
	
     nfound = select(nfds, readfds, writefds, exceptfds, timeout)
     int nfound, nfds;
     fd_set *readfds, *writefds, *exceptfds;
     struct timeval *timeout;

The only references to "exceptfds" I can find say that it "indicates
if an exceptional condition is pending" (man page); "indicates when exceptional
conditions exist for particular file descriptors, useful in networking"
(Bach); and misc. discussions about reading and writing (Leffler et. al.)

My guess is that the appropriate bit in exceptfds is set when the i/o 
channel associated with a descriptor is lost, or in the case of some 
sockets, out of band data is present (or maybe that would be readfds?).

Does anyone know for sure what a set bit in exceptfds indicates (what an
"exceptional condition" is)?

Mike Garzione
Convex Computer Corporation                            
{uunet,sun}!convex!garzione
garzione@convex.com

mike@turing.cs.unm.edu (Michael I. Bushnell) (03/24/90)

The execptfds argument in 4.3BSD is only used to indicate that Out of
Band data is available for reception.  In particular, end of file (and
loss of the channel, which is a special case of EOF) is reported as
availability for reading, and zero bytes will be read, indicating EOF.

	-mib

PS: In fact, that's all it was originally intended to do, anyway.

--
    Michael I. Bushnell      \     This above all; to thine own self be true
LIBERTE, EGALITE, FRATERNITE  \    And it must follow, as the night the day,
   mike@unmvax.cs.unm.edu     /\   Thou canst not be false to any man.
        CARPE DIEM           /  \  Farewell:  my blessing season this in thee!