Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 1997 11:54:25 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@freebsd.org
Subject:   Why FIONREAD has no dual for write ?
Message-ID:  <199712061054.LAA25661@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
I think I already brought this out but recent discussion on mpegtv
suggests to bring this out again.

FIONREAD tells you how many bytes you can read before blocking.

There is no FIONWRITE call (how many bytes you can write before
blocking) which would be nice to have, instead of having to resort to
non-blocking writes.

And there is no FIOWQUEUED call (or similar name) to tell how many
bytes are queued for I/O on a given descriptor.

The latter could be used e.g. in audio drivers to extract sync
information from the driver itself. Or on sockets/pipes, to decide
whether there is a risk that the pipe runs dry.

Are these only necessary for real-time purposes ? And even in that
case, since pseudo real-time apps are coming out (e.g. audio/video,
driving a CD writer, etc.) wouldn't it be worthwile adding them ?

Implementation would be rather trivial in many cases (for audio they
are already there under a different name; for sockets it suffices to
check the socket buffer size, ...)

	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712061054.LAA25661>