[uClibc]fseek(3) idempotency

Erik Andersen andersen at codepoet.org
Mon Sep 24 22:55:29 UTC 2001


On Mon Sep 24, 2001 at 04:50:47PM -0600, Matt Kraai wrote:
> On Mon, Sep 24, 2001 at 04:45:11PM -0600, Erik Andersen wrote:
> > Pulling out my copy of Posix/IEEE 1003.1b-1993, and it seems to agree
> > with SuS2:
> > 
> > Some devices are incapable of seeking.  The value of the file offset associated
> > with such a device is undefined.  The behavior of the lseek() function on such
> > devices is implementation defined.
> > 
> > ...Otherwise, it shall return a value of ((off_t)-1), shall set errno to
> > indicate the error, and the file offset shall remain unchanged by this function
> > call.
> 
> So if you don't know a priori that a file is not a pipe, you can't
> call [fl]seek on it?  This is retarded.

Nobody ever accused the standards folks of intelligence. :)
Since uClibc is already Linux specific, I agree with Michael,
we can safely rely on doing whatever glibc does in this case.
What does Manuel's is_seekable do on pipes when compiled with
glibc?

 -Erik

--
Erik B. Andersen   email:  andersee at debian.org, formerly of Lineo
--This message was written using 73% post-consumer electrons--





More information about the uClibc mailing list