From owner-freebsd-current@FreeBSD.ORG Thu Aug 4 06:03:02 2005 Return-Path: X-Original-To: current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3054816A41F for ; Thu, 4 Aug 2005 06:03:02 +0000 (GMT) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82FE043D46 for ; Thu, 4 Aug 2005 06:03:01 +0000 (GMT) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.13.4/8.13.4) with ESMTP id j7462rwh021349; Thu, 4 Aug 2005 10:02:53 +0400 (MSD) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.13.4/8.13.4/Submit) id j7462rgc021348; Thu, 4 Aug 2005 10:02:53 +0400 (MSD) (envelope-from ache) Date: Thu, 4 Aug 2005 10:02:51 +0400 From: Andrey Chernov To: Maxim.Sobolev@portaone.com Message-ID: <20050804060251.GA21228@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Maxim.Sobolev@portaone.com, Dan Nelson , "current@freebsd.org" References: <42F0CCD5.9090200@portaone.com> <20050803150117.GD93405@dan.emsphone.com> <42F0E9B2.9080208@portaone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42F0E9B2.9080208@portaone.com> User-Agent: Mutt/1.5.9i Cc: Dan Nelson , "current@freebsd.org" Subject: Re: Sub-optimal libc's read-ahead buffering behaviour X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 06:03:02 -0000 On Wed, Aug 03, 2005 at 06:58:42PM +0300, Maxim Sobolev wrote: > Checking the actual code confirm your point, thank you! However, I think > that the current behaviour is at best inconsistent, since it in fact > does buffering of character devices in some cases but does not in some > others. In my example it reads 4096 bytes instead of requested 512 at > each request, but when the program does fseek it rejects part of that > buffer and does re-positioning and re-reading. Very confusing behaviour > IMHO. No surprize. Single read can be consider as sort of "atomic" operation. But between read & seek character device itself can move its pointer in anyplace. -- http://ache.pp.ru/