[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fseeko bug
Re: fseeko bug
Fri, 14 Dec 2007 22:35:14 -0700
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/20071031 Thunderbird/220.127.116.11 Mnenhy/0.7.5.666
-----BEGIN PGP SIGNED MESSAGE-----
According to Larry Jones on 12/14/2007 9:41 AM:
> Eric Blake writes:
>> Larry Jones <lawrence.jones <at> siemens.com> writes:
>>> On a more general note, it looks like fseeko and ftello both need more
>>> work to be generally useful on platforms that have a wide off_t but
>>> don't have native fseeko/ftello.
>> Name such a platform, then we'll worry about it.
> BSD/OS 4.2, but it's obsolete and thus easily ignored. But isn't that
> the main point of having fseeko and ftello in gnulib?
There are two reasons for fseeko. One is for platforms that lack it. But
the other is for POSIX compliance for the requirement to position the
underlying fd offset when seeking on input streams (many BSD-based
implementations only follow the C99 rules, where such behavior is
undefined; but several GNU programs rely on the POSIX semantics where such
behavior is well-defined).
> If not, then
> there doesn't seem to be any reason for having the messy code in fseeko
> that grubs around in the FILE structure so as to be able to call lseek;
> just call the native fseek[o] and be done with it.
The messy code is for the POSIX compliance bit. Providing the replacement
fseeko for platforms that lack it is indeed much easier if it weren't for
this other aspect.
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----