From owner-freebsd-hackers Tue Dec 9 19:20:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA07271 for hackers-outgoing; Tue, 9 Dec 1997 19:20:50 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA07264 for ; Tue, 9 Dec 1997 19:20:43 -0800 (PST) (envelope-from tlambert@usr06.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id UAA14226; Tue, 9 Dec 1997 20:18:05 -0700 (MST) Received: from usr06.primenet.com(206.165.6.206) via SMTP by smtp02.primenet.com, id smtpd014183; Tue Dec 9 20:17:54 1997 Received: (from tlambert@localhost) by usr06.primenet.com (8.8.5/8.8.5) id UAA03733; Tue, 9 Dec 1997 20:05:26 -0700 (MST) From: Terry Lambert Message-Id: <199712100305.UAA03733@usr06.primenet.com> Subject: Re: Why FIONREAD has no dual for write ? To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Wed, 10 Dec 1997 03:05:26 +0000 (GMT) Cc: bakul@torrentnet.com, hackers@FreeBSD.ORG In-Reply-To: <199712090457.FAA00305@labinfo.iet.unipi.it> from "Luigi Rizzo" at Dec 9, 97 05:57:11 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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...). I still believe that this is the responsibility of the driver. If the driver owns a double buffer instead of relying on system owned resources only "loaned" to it, then it will be able to be written in buffer size chunks, or not at all. This neatly resolves the portability issues, and places the onus for driver behaviour where it rightly belongs: with the driver. Screwing with these watermarks still puts the onus on the driver to allocate the system resources before it can answer your select() "yes, writeable". Since the onus is there anyway, why make the programatic interface both more complex (for no visible gain) and less portable (for no visible gain)? Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.