[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on "dd" using "seek" vs. "read" & >32-bit sizes

From: Bob Proulx
Subject: Re: on "dd" using "seek" vs. "read" & >32-bit sizes
Date: Fri, 16 Dec 2005 11:03:27 -0700
User-agent: Mutt/1.5.9i

Paul Eggert wrote:
> Linda Walsh writes:
> > Second question I had -- at times, it seems like various utils
> > are limited to 2G file offsets on OS's (i686-linux, i686-cygwin)
> > that support files >2G.  Is this "old" behavior
> Yes; modern coreutils versions shouldn't have 2 GiB limits for file
> sizes.

I thought I would add a little more context here.  For any 32-bit
program the legacy filesize is limited to a signed 32-bit long value.
Modern program environments improve upon this by using an extended
64-bit file offset type instead of the legacy 32-bit value.

As of several years ago off_t was expanded to a 64-bit value.  This
allowed programs using the modern off_t variable type to work with
large files.  The two requirements on software were to change from
variable type long to variable type off_t and to include cpp defines
FILE_OFFSET_BITS=64 (or others) to define off_t as a 64-bit value.

The autoconf generated "configure" script will create the necessary
tests to switch on large file mode automatically.  Therefore the
actual ability of the program to handle large files is dependent upon
your compile environment.  If it supports large files then your
generated program will too.  If it does not support large files then
your generated program will not.  (And of course any 64-bit gets large
file support for free because long is natively 64-bits there.  So this
question only applies to 32-bit systems.)

When I "./configure" coreutils on a 32-bit system I see the following.

  checking for special C compiler options needed for large files... no
  checking for _FILE_OFFSET_BITS value needed for large files... 64
  checking for _LARGE_FILES value needed for large files... no

If you have an old compilation of coreutils on an old system which did
not support large files or were using an old version of coreutils
which did not set FILE_OFFSET_BITS=64 itself then the resulting
programs will not be large file capabile.  (e.g. On HP-UX when
compiling the old fileutils it was necessary to add that as an
additional cpp define to enable working with large file.)

If you are working with other software that uses older versions of
autoconf on a 32-bit system then you may find that don't set these
options automatically at compile time and they must be manually


reply via email to

[Prev in Thread] Current Thread [Next in Thread]