From owner-freebsd-hackers Mon Dec 8 21:58:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id VAA02176 for hackers-outgoing; Mon, 8 Dec 1997 21:58:06 -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 VAA02157 for ; Mon, 8 Dec 1997 21:58:01 -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 FAA00305; Tue, 9 Dec 1997 05:57:12 +0100 From: Luigi Rizzo Message-Id: <199712090457.FAA00305@labinfo.iet.unipi.it> Subject: Re: Why FIONREAD has no dual for write ? To: bakul@torrentnet.com (Bakul Shah) Date: Tue, 9 Dec 1997 05:57:11 +0100 (MET) Cc: hackers@freebsd.org In-Reply-To: <199712090045.TAA06826@chai.torrentnet.com> from "Bakul Shah" at Dec 8, 97 07:44:46 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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(). > > Perhaps one solution is to add an ioctl to set high/low > watermarks on a device and add new event bits POLLIN_WM and > POLLLOUT_WM for the poll() syscall. Good idea, this could solve the blocksize problem rather elegantly (although with some portability problems...). > > 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. > > This can be handled by POLL{IN,OUT}_WM. not sure how... if i get it right your changes can tell a process when you can transfer x >= WM bytes, but gives no clue about the current status of the queue. Much like the difference between Q. Excuse me Sir, do you know what time is it ? A. Yes. and Q. Excuse me Sir, do you know what time is it ? A. 9:30 Cheers 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/ _____________________________|______________________________________