From owner-cvs-lib Sat Nov 5 10:49:40 1994 Return-Path: cvs-lib-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.8/8.6.6) id KAA23189 for cvs-lib-outgoing; Sat, 5 Nov 1994 10:49:40 -0800 Received: (from nate@localhost) by freefall.cdrom.com (8.6.8/8.6.6) id KAA23179; Sat, 5 Nov 1994 10:49:36 -0800 Date: Sat, 5 Nov 1994 10:49:36 -0800 From: Nate Williams Message-Id: <199411051849.KAA23179@freefall.cdrom.com> To: CVS-commiters, cvs-lib Subject: cvs commit: src/lib/libc/stdio fseek.c Sender: cvs-lib-owner@FreeBSD.org Precedence: bulk nate 94/11/05 10:49:35 Modified: lib/libc/stdio fseek.c Log: Date: Wed, 26 Oct 1994 15:44:49 -0600 From: Chris Torek Here is a semi-official patch (apply to /usr/src/lib/libc/stdio/fseek.c, rebuild libc, install). The current code fails when the seek: - is optimized, and - is to just past the end of the block currently in the buffer, and - is followed by another seek with no intervening read operation, and - the destination of subsequent seek is within the block left in the buffer (seeking to the beginning of a block does not force a read, so the buffer still contains the previous block) so it is indeed rather obscure. I may have a different `final' fix, as this one `loses' the buffer contents on a seek that goes just past the end of the current block. [Footnote: seeks are optimized only on read-only opens of regular files that are buffered by the file's optimal I/O size. This is what you get with fopen(path, "r") and no call to setvbuf().] Obtained from: [ BSDI mailing list ] From owner-cvs-lib Sat Nov 5 11:05:42 1994 Return-Path: cvs-lib-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.8/8.6.6) id LAA23245 for cvs-lib-outgoing; Sat, 5 Nov 1994 11:05:42 -0800 Received: from Root.COM (implode.Root.COM [198.145.90.1]) by freefall.cdrom.com (8.6.8/8.6.6) with ESMTP id LAA23239; Sat, 5 Nov 1994 11:05:34 -0800 Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.18]) by Root.COM (8.6.8/8.6.5) with ESMTP id LAA01903; Sat, 5 Nov 1994 11:05:46 -0800 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.9/8.6.5) with SMTP id LAA11674; Sat, 5 Nov 1994 11:05:46 -0800 Message-Id: <199411051905.LAA11674@corbin.Root.COM> X-Authentication-Warning: corbin.Root.COM: Host localhost didn't use HELO protocol To: Nate Williams cc: CVS-commiters@freefall.cdrom.com, cvs-lib@freefall.cdrom.com Subject: Re: cvs commit: src/lib/libc/stdio fseek.c In-reply-to: Your message of "Sat, 05 Nov 94 10:49:36 PST." <199411051849.KAA23179@freefall.cdrom.com> From: David Greenman Reply-To: davidg@Root.COM Date: Sat, 05 Nov 1994 11:05:46 -0800 Sender: cvs-lib-owner@FreeBSD.org Precedence: bulk >nate 94/11/05 10:49:35 > > Modified: lib/libc/stdio fseek.c > Log: > Date: Wed, 26 Oct 1994 15:44:49 -0600 > From: Chris Torek > Here is a semi-official patch (apply to /usr/src/lib/libc/stdio/fseek.c, > rebuild libc, install). The current code fails when the seek: ... > Obtained from: [ BSDI mailing list ] Other patches from ftp.bsdi.com need to be examined and incorporated if appropriate as well. I started doing this a few weeks ago, but then got sidetacked with more important things...then got sick, etc. -DG