From owner-freebsd-hackers Mon Dec 8 14:02:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA18128 for hackers-outgoing; Mon, 8 Dec 1997 14:02:57 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA18121 for ; Mon, 8 Dec 1997 14:02:50 -0800 (PST) (envelope-from avalon@coombs.anu.edu.au) Message-Id: <199712082202.OAA18121@hub.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA066698516; Tue, 9 Dec 1997 09:01:57 +1100 From: Darren Reed Subject: Re: Why FIONREAD has no dual for write ? To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Tue, 9 Dec 1997 09:01:56 +1100 (EDT) Cc: tlambert@primenet.com, julian@whistle.com, hackers@FreeBSD.ORG In-Reply-To: <199712081945.UAA29200@labinfo.iet.unipi.it> from "Luigi Rizzo" at Dec 8, 97 08:45:09 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In some mail from Luigi Rizzo, sie said: [...] > > It's short, it's elegant, and you can still use "select()" for the > > readability/writeability to avoid turning the program into a polling > > loop. > > I agree with the above, except that it does not work in all situations. > E.g. I am not sure but does select() guarantee that you don't > end up writing/reading one byte at a time ? I know in practice things > are different, but there is no standard behaviour I think, so the risk > is still there. In the audio driver I had to modify the behaviour of > select() (block size) using a separate ioctl(). I don't know how select() works with drivers such as the audio drivers, but I've only encountered one OS which returned an fd as witeable when it wasn't and it hasn't been possible to buy that particular Unix for some years now. > Plus there are apps which want only to check the status of the queue in > a descriptor without actually doing the I/O, for whatever reason they > like. You can still use select for this. Darren