Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Dec 1997 17:08:18 +1100 (EST)
From:      Ada <ada@not-enough.bandwidth.org>
To:        hackers@FreeBSD.ORG
Subject:   Re: Why FIONREAD has no dual for write ?
Message-ID:  <199712160608.RAA03776@noether.blah.org>
In-Reply-To: <199712091520.HAA09154@hub.freebsd.org> from "owner-hackers-digest@FreeBSD.ORG" at "Dec 9, 97 07:20:23 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> From: Bakul Shah <bakul@torrentnet.com>
> Date: Mon, 08 Dec 1997 19:45:05 -0500
> Subject: Re: Why FIONREAD has no dual for write ? 
> 
> 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.
> 
> In pollfd->events you set these bits instead of (or in
> addition to) POLLIN/POLLOUT.  On return the corresponding bit
> in pollfd->revents is set only if there are _greater than low
> watermark_ bytes on input and _less than high watermark_
> bytes on output.  This guarantees that you can transfer some
> minimum number of bytes on read/write (provided you use the
> O_EXCL mode).
> 
> This is a more general solution that allows finer control
> over when to schedule IO and is useful in all sorts of
> situations.

How about a counterpart to select() which can request a minimum number
of bytes {free,ready} in the buffer?  This could also be useful in
situations where one does not wish to implement buffering; instead the
kernel buffers could be used.

Is this feasable in light of how select() works?

Ada.



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