Steffen "Daode" Nurpmeso
2012-09-14 21:56:22 UTC
I guess that on page 978, line 31922, "open file description"
truly means an "open file descriptor". In full
If the most recent operation, other than ftell(), on a given
stream is fflush(), the file offset in the underlying open file
descriptOR shall be adjusted to reflect the location specified
by fseek()
and the entire paragraph is marked as CX (supported on all
conforming systems) and furthermore this very behaviour was
already described for IEEE Std 1003.1, 1996 Edition.
While searching for a "bug" in my copy of nail(1) (Heirloom
mailx(1)) i've actually ended up at
fflush(fi);
rewind(fi);
lseek(fileno(fi), 0, SEEK_SET);
which caused nail(1) to fail on Mac OS X Snow Leopard, FreeBSD 9,
NetBSD 6 RC1 and OpenBSD 5.1. (Where "fail" means that the
content of dead.letter, to which *fi* will be dumped next,
contained the content of *fi* twice..) This behaviour disappeared
on all systems when the lseek(2) was removed.
I for one really don't know why the STDIO stuff simply assumes
it's offset is correct.
Ciao,
truly means an "open file descriptor". In full
If the most recent operation, other than ftell(), on a given
stream is fflush(), the file offset in the underlying open file
descriptOR shall be adjusted to reflect the location specified
by fseek()
and the entire paragraph is marked as CX (supported on all
conforming systems) and furthermore this very behaviour was
already described for IEEE Std 1003.1, 1996 Edition.
While searching for a "bug" in my copy of nail(1) (Heirloom
mailx(1)) i've actually ended up at
fflush(fi);
rewind(fi);
lseek(fileno(fi), 0, SEEK_SET);
which caused nail(1) to fail on Mac OS X Snow Leopard, FreeBSD 9,
NetBSD 6 RC1 and OpenBSD 5.1. (Where "fail" means that the
content of dead.letter, to which *fi* will be dumped next,
contained the content of *fi* twice..) This behaviour disappeared
on all systems when the lseek(2) was removed.
I for one really don't know why the STDIO stuff simply assumes
it's offset is correct.
Ciao,