[PATCH 1/3] Change _offset type from int to _off_t

Corinna Vinschen vinschen@redhat.com
Mon Nov 26 16:26:00 GMT 2012

On Nov 23 13:24, Sebastian Huber wrote:
> On 11/23/2012 11:21 AM, Corinna Vinschen wrote:
> >On Nov 22 12:24, Sebastian Huber wrote:
> >>2012-11-22  Sebastian Huber <sebastian.huber@embedded-brains.de>
> >>
> >>	* libc/include/sys/reent.h (__sFILE): Change type of _offset
> >>	from int to _off_t.
> >>[...]
> >>It breaks binary compatibility also on some RTEMS targets, but this is
> >>not a problem.
> >
> >It breaks binary compatibility.  Full stop.  And this is a problem.
> Yes, this is a problem, but not for RTEMS.
> >
> >If we do that, we must make really sure that this isn't a problem.
> We can add a new type, which is int by default and for example _off_t on RTEMS.

But this new type doesn't match your fseeko/ftello implementation

> >
> >For instance, on 32 bit Cygwin, _off_t is 32 bit (while off_t ==
> >_off64_t), so the change from int to _off_t would not break the ABI.
> >
> >But newlib is not only RTEMS and Cygwin, that's the problem.
> >
> >However, see the thread starting at
> >http://sourceware.org/ml/newlib/2012/msg00214.html
> >
> >In theory you're not supposed to change struct __sFILE, rather you're
> >supposed to use struct __sFILE64 and the functions defined in the
> >libc/stdio64 subdir.  This discussion seems to have gone lost.
> Ok, and how can I do this.  Is this a configure option?  I don't
> want to use fseeko64() directly.

Why not?  Cygwin is doing the same.  The application calls fseeko,
but internally Cygwin calls fseeko64 since the link lib redirects
the call.  fseeko64 does not exist on the application level.


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list