Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Nov 1994 10:49:36 -0800
From:      Nate Williams <nate>
To:        CVS-commiters, cvs-lib
Subject:   cvs commit: src/lib/libc/stdio fseek.c
Message-ID:  <199411051849.KAA23179@freefall.cdrom.com>

next in thread | raw e-mail | index | archive | help
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 <torek@bsdi.com>
  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 ]



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