scp doesn't work with large (>2GB) files

Michael Stone mstone at cs.loyola.edu
Wed Sep 12 22:10:07 EST 2001


On Wed, Sep 12, 2001 at 12:14:47PM +0100, M.C. Vernon wrote:
> On Wed, 12 Sep 2001, Markus Friedl wrote:
> > why is O_LARGEFILE needed? is this some standard API?
> 
> It's not a standard API, except on Solaris/SunOS and Linux (as far as a
> quick look will tell me). HP-UX 11i has this flag and notes "This is a
> non-standard flag which may be used by 32-bit applications to access files
> larger than 2 GB". OTOH, on those platforms, open() will fail on files
> bigger than 2GB. This seems to me a good reason to include this flag on
> platforms where it is defined. 

Actually, it's a terrible idea, because off_t will still be 32 bits.
What would work is
#define _FILE_OFFSET_BITS 64
which would make off_t 64 bits and add an implicit O_LARGEFILE. (That's
what most of the utilities using O_LARGEFILE would be doing.) You can
take a look at the configure routines from some of the GNU utilities
(e.g., fileutils) to see how they do the large file support detection.

-- 
Mike Stone



More information about the openssh-unix-dev mailing list