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

Jani Jaakkola jjaakkol at cs.Helsinki.FI
Wed Sep 12 22:33:58 EST 2001


On Wed, 12 Sep 2001, Michael Stone wrote:

> 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.

You beat me to it. O_LARGEFILE should be considered part of Linux system
internals and not be used directly by software intended to be portable.

My educated guess is, that if you include '#define _FILE_OFFSET_BITS 64'
into every .c file (preferably by config.h) in openssh distribution or
just use  '-D_FILE_OFFSET_BITS=64' while compiling it, it would work just
fine with >2G files assuming you have glibc >= 2.1 and kernel >=2.4 (or
64 bit hardware, but then you won't need _FILE_OFFSET_BITS).

- Jani




More information about the openssh-unix-dev mailing list