Subject: rewind(3) question
To: None <current-users@NetBSD.ORG>
From: Jaromir Dolecek <dolecek@ics.muni.cz>
List: current-users
Date: 07/06/1998 04:26:33
ANSI guru wanted ;)
After about 3 hours of investigating why my code doesn't work
on Linux when it works perfectly OK under NetBSD & Solaris I've found
out it's Linux's rewind(3) behaviour, which is other than I expect.
Well, I have a stdio stream (created by tmpfile()). Data to the
underlying descriptor are written directly by write(2), then rewind(3)
is called and data are read via fread(). Until now I thought
rewind(3) does implicit lseek(2) every time. But it's definitely not true
under Linux.
What ANSI spec says ? Should rewind(3) work even when
stdio functions are bypassed and data are written to descriptor directly ?
Anyway, I praise BSDs for taking safe approach. And I'd like to know
if Linux's approach is broken or the behaviour is unspecified.
--
Jaromir Dolecek <dolecek@ics.muni.cz> http://www.ics.muni.cz/~dolecek/
-------------------------------------------------------------------------
It is better never to have been born. But who among us has such luck?
One in a million, perhaps.