Nate Williams 692a99c012 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 ]
1994-11-05 18:49:34 +00:00
..
1994-10-12 02:06:02 +00:00
1994-10-26 18:17:41 +00:00
1994-10-26 18:15:35 +00:00
1994-11-01 09:14:39 +00:00
1994-11-04 02:14:13 +00:00
1994-08-21 19:26:22 +00:00
1994-05-27 05:00:24 +00:00
1994-10-27 18:15:42 +00:00
1994-08-08 19:26:23 +00:00
1994-09-24 02:59:15 +00:00
1994-05-27 05:00:24 +00:00
1994-09-08 10:40:23 +00:00
1994-10-28 06:58:04 +00:00
1994-10-27 11:07:34 +00:00