From owner-freebsd-hackers Sat Dec 6 03:56:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA12347 for hackers-outgoing; Sat, 6 Dec 1997 03:56:10 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id DAA12305 for ; Sat, 6 Dec 1997 03:55:58 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA25661; Sat, 6 Dec 1997 11:54:25 +0100 From: Luigi Rizzo Message-Id: <199712061054.LAA25661@labinfo.iet.unipi.it> Subject: Why FIONREAD has no dual for write ? To: hackers@freebsd.org Date: Sat, 6 Dec 1997 11:54:25 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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/ _____________________________|______________________________________