[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.91,2.92

Trent Mick trentm@ActiveState.com
Mon, 13 Nov 2000 13:59:05 -0800


On Mon, Nov 13, 2000 at 04:38:01PM -0500, Guido van Rossum wrote:
> > > Log Message:
> > > Added _HAVE_BSDI and __APPLE__ to the list of platforms that require a
> > > hack for TELL64()...  Sounds like there's something else going on
> > > really.  Does anybody have a clue I can buy?
> > 
> > Yes, there is. For all of these platforms HAVE_LARGEFILE_SUPPORT is defined
> > when it should not really be. Essentially, these platforms lie when they say
> > they support largefiles, at least according to the configure test for
> > HAVE_LARGEFILE_SUPPORT>
> 
> Mh...  Thanks.  And how are we testing for large file support?
> Perhaps the test should be improved rather than hacks piled on top of
> each other?  What's wrong with the current test?
> 

I agree: the test should improve. Here it is:

AC_MSG_CHECKING(whether to enable large file support)
if test "$have_long_long" = yes -a \
    "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
    "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
  AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi


BSDI, etc pass this test but do not have 64-bit capable ftell/fseek functions
(i.e. ones that use that off_t variable that is as big as a LONG_LONG). In
posix these are called ftello/fseeko. We also check for ftell64/fseek64 (I
think). In windows is is _tell64, I think. ...anyway there are a lot of ways
to spell it.

I don't know right away how to translate that into an appropriate configure
test. I.e. how do you test that the platform has an ftell/fseek-like function
that uses an index variable whose sizeof() is at least 8. 

Note that, IIRC, windows had some funny case where the test above would have
failed but that was okay because there were lower level I/O functions that
used a 64-bit capable fpos_t (instead of off_t). I can't remember the exact
details. 



Trent


-- 
Trent Mick
TrentM@ActiveState.com