Re: File > 2gb

From: Andrew Gabriel (andrew_at_cucumber.demon.co.uk)
Date: 07/29/03


Date: 29 Jul 2003 18:09:17 GMT

In article <SPwVa.48591$PD3.4512260@nnrp1.uunet.ca>,
        "cc" <ultraman@rogers.com> writes:
> "Andrew Gabriel" <andrew@cucumber.demon.co.uk> wrote in message
> news:bg62ol$7po$1@new-usenet.uk.sun.com...
>> In article <qdvVa.48540$PD3.4511978@nnrp1.uunet.ca>,
>> "cc" <ultraman@rogers.com> writes:
>> > Hi there,
>> > I compiled my program under sun 5.4 and ran it in 5.7, but stat call
>> > failed with file > 2GB and returns error code 79. I did
>> > se -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to compile. I checked
> stat.h
>> > in 5.4 and there is no stat64. Any idea to compile under 5.4 and make it
>> > work on 5.7 and up with 2GB file? TIA
>>
>> Solaris 2.6 is the first release you can build largefile(5) aware apps.
>> Prior to that, -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 won't have
>> any effect.
>
> so is there any way to compile under 5.4 to support large file?

Not supported.

I guess you could make your own wrapper library for the *64 functions
under Solaris 2.4 which just mapped back to the 32 bit equivalents.
Then build your executable under 2.6 or 7 and try running with your
wrapper library LD_PRELOAD'ed under 2.4. There are loads of reasons
this might not work though, and as I said, it's not supported.
Another way might be to build under 2.4 using some of the 2.6 or 7
header files to map calls like stat to stat64, and then via your
*64 wrapper functions. All sounds horribly messy...

-- 
Andrew Gabriel


Relevant Pages

  • Re: Thou shalt have no other gods before the ANSI C standard
    ... > fseek is a primary example of the total uselessness of the ANSI/ISO C ... compiler can support as an int, so if they support 128-bit int, you ... know better anyway) fixated on security, security, security. ... created a set of wrapper functions to allow me to the ...
    (sci.crypt)
  • Re: Large files on 32 and 64 bits ystem
    ... explains how large file support works in GNU/Linux. ... fwriteet al to use 64-bit file offsets instead of the ... wrapper functions in adaint.c that call fopen, fwrite, etc. ... properly on all platforms, with and without LFS). ...
    (comp.lang.ada)
  • 2.6.19-rt3: compilation failure
    ... Upon an attempt to compile 2.6.19-rt3 I encountered the following compile ... The kernel .config file follows. ... # Firmware Drivers ... # ACPI Support ...
    (Linux-Kernel)
  • Re: [PATCH] kbuild: work around distcc/icecc madness
    ... Peter and I noticed that distcc and icecc based kernel compiles ... The root cause for this problem is the check for the CFI support in ... When distcc/icecc offload the compile to a remote ... # AX.25 network device drivers ...
    (Linux-Kernel)
  • 2.6.16.6 ( - 2.6.16.11 ) compile failure on an alpha
    ... When trying to compile 2.6.16.11 on an alpha I encountered a compile ... # Linux kernel version: 2.6.16.5 ... # PCCARD support ... # Device Drivers ...
    (Linux-Kernel)