[uClibc]fseek(3) idempotency

Manuel Novoa III mjn3 at uclibc.org
Mon Sep 24 16:03:03 UTC 2001


Matt,

On Mon, Sep 24, 2001 at 09:25:31AM -0600, Matt Kraai wrote:
> The uClibc fseek(3) implementation clears the readahead buffer
> before calling lseek(2).  If lseek(2) fails (e.g., it is called on
> a pipe), the position is now off.

In my interpretation of the standards, if fseek() fails the error
indicator for the stream is set and the associated file offset is
undefined.  What's the problem?

>                 The following patch only resets
> the readahead buffer if the lseek(2) call succeeds.

It looks to me like you're trying to deal with an application bug
by introducing implementation-defined behavior to uClibc.

Manuel





More information about the uClibc mailing list