This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: fseek064 calling fflush on Cygwin
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 13 Jul 2007 10:50:53 -0600
- Subject: Re: fseek064 calling fflush on Cygwin
- References: <Pine.CYG.4.58.0706221436300.4312@PC1163-8460-XP.flightsafety.com> <loom.20070622T222112-683@post.gmane.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 6/22/2007 2:26 PM:
>> So, it would seem that fflush is not 64 bit safe and fseeko64 should not
>> be calling it, but I'm not sure how to fix it.
>>
> In environments with large files, fflush needs to check for __SL64, in which
> case it should call fp->_seek64, not fp->_seek. That clinches it - I need to
> complete my patch to make fflush reentrant and 64-bit safe. I'll hopefully
> have something by early next week.
So much for 'early next week'. Here's the full patch - okay to apply?
2007-07-13 Eric Blake <ebb9@byu.net>
Fix fflush issues.
* libc/stdio/fflush.c (_fflush_r): New function.
(fflush): Fix reentrancy and large offset behavior.
* libc/include/stdio.h (_fflush_r): Add prototype.
* libc/stdio/fclose.c (_fclose_r): All fflush callers changed.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/fseek.c (_fseek_r): Likewise.
* libc/stdio/ftell.c (_ftell_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Likewise.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/setvbuf.c (setvbuf): Likewise.
* libc/stdio/ungetc.c (_ungetc_r): Likewise.
* libc/stdio/vfprintf.c (__sbprintf): Likewise.
* libc/stdio/wbuf.c (__swbuf_r): Likewise.
* libc/stdio64/freopen64.c (_freopen64_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise. Defer to
32-bit version if not large file.
* libc/stdio64/ftello64.c (_ftello64_r): Likewise.
* libc/stdio64/tmpfile64.c (_tmpfile64_r): Avoid compile warning.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----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
iD8DBQFGl61s84KuGfSFAYARAkClAKC8CVrGB5A4o45L8Qg/0bA/U5CPvQCgtpiv
9TKVVbHgaUP5tu4sT991Nek=
=HRej
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/