[squeak-dev] filesize reporting 0 for very large files
David T. Lewis
lewis at mail.msen.com
Mon Mar 19 02:11:45 UTC 2012
On Sun, Mar 18, 2012 at 10:00:46PM -0400, David T. Lewis wrote:
> On Sun, Mar 18, 2012 at 06:55:10PM -0700, Eliot Miranda wrote:
> > Hi David,
> >
> > On Sun, Mar 18, 2012 at 6:30 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> >
> > > On a Linux system, the data types that represent file positions are 32 bits
> > > in size when the program is compiled in 32-bit mode (using the -m32
> > > compiler
> > > option), and they are 64 bits in size when the program is compiled in
> > > 64-bit
> > > mode. The relevant data types are off_t and size_t, and if you compile the
> > > following in 32-bit mode (-m32) and compare the same program compiled in
> > > 64-bit mode, you can see the difference:
> > >
> > > #include <stdio.h>
> > > #include <sys/types.h>
> > > main() {
> > > printf("off_t is %d\n", sizeof(off_t));
> > > printf("size_t is %d\n", sizeof(size_t));
> > > }
> > >
> >
> > Not quite. One can modify this by defining something like
> > _LARGEFILE64_SOURCE at compile time. e.g.
> > see _LARGEFILE_SOURCE _LARGEFILE64_SOURCE & _FILE_OFFSET_BITS in
> > http://www.delorie.com/gnu/docs/glibc/libc_13.html. I'll check that the
> > appropriate one is defined when building Cog asap.
>
> Excellent, thank you!
(CC to vm-dev)
I note that Nicolai Hess has just added a note to the Mantis issue with
a similar tip and pointers to additional things that may need attention
in the support code.
http://bugs.squeak.org/view.php?id=7522
Dave
More information about the Squeak-dev
mailing list
|