This is the mail archive of the
mailing list for the newlib project.
Re: RTEMS Targets Issue #2 - ftello()/fseeko()
- From: Yaakov Selkowitz <yselkowitz at cygwin dot com>
- To: newlib at sourceware dot org
- Date: Sun, 20 Mar 2016 18:19:10 -0500
- Subject: Re: RTEMS Targets Issue #2 - ftello()/fseeko()
- Authentication-results: sourceware.org; auth=none
- References: <56ED87FD dot 2050406 at oarcorp dot com> <56EE1A83 dot 5030101 at cygwin dot com> <20160320123524 dot GC24954 at calimero dot vinschen dot de> <56EEF780 dot 5090907 at cygwin dot com> <20160320211425 dot GF3422 at calimero dot vinschen dot de>
On 2016-03-20 16:14, Corinna Vinschen wrote:
On Mar 20 14:18, Yaakov Selkowitz wrote:
On 2016-03-20 07:35, Corinna Vinschen wrote:
Note especially the _FILE_OFFSET_BITS == 64. So fseeko/ftello are
always defined on systems with sizeof(off_t) == 8.
This is the exception to the "-D_FILE_OFFSET_BITS=64 as no affect on 64-bit
systems" rule; try compiling with -ansi and you should see they are not.
Note that _POSIX_C_SOURCE=200809L is on by default, so maybe that's what
I'm not sure I understand. I only referred to the man page, I didn't
test this. Can you expand on this a bit?
_FILE_OFFSET_BITS is just another feature test macro, which means that
off_t should be 64-bit, and standard functions which use off_t should be
redirected to the 64-bit variants. It is not defined automatically on
64-bit platforms (even where off_t is *naturally* 64-bit).
I still have to implement this and the _LARGEFILE64_SOURCE (which
exposes off64_t and the open64 family of functions) feature test macros.
This is a bit tricky because Cygwin is different from other platforms
in this regard. For now, adding my pending patch for POSIX.1-2001
enablement should suffice.