Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Dec 1997 05:57:11 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        bakul@torrentnet.com (Bakul Shah)
Cc:        hackers@freebsd.org
Subject:   Re: Why FIONREAD has no dual for write ?
Message-ID:  <199712090457.FAA00305@labinfo.iet.unipi.it>
In-Reply-To: <199712090045.TAA06826@chai.torrentnet.com> from "Bakul Shah" at Dec 8, 97 07:44:46 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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/
_____________________________|______________________________________



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