[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Fwd: Re: 64 bit file support
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-08-10 21:35:16
[Download RAW message or body]

On Friday 10 August 2001 11:53 am, Waldo Bastian wrote:
> This solution won't work under Linux, though.  Linux headers define "struct
> stat" based on the value of _FILE_OFFSET_BITS.  If you place the line
> "#define _FILE_OFFSET_BITS 64" prior to any #include's in your source, you
> get the 64 bit version, otherwise you get the 32 bit version.  An
> unfortunate side effect of this is that all system calls, such as open and
> truncate,  get a #define like this:
>
> #define open open64
> #define truncate truncate64
>
> This caused problems with some QT member functions which had the same name
> as a system call.  For example, QString::truncate() was renamed
> QString::truncate64(), which did not resolve against the QT dynamic
> library.

The solution to this seems to be to define _LARGEFILE_SOURCE and 
_LARGEFILE64_SOURCE and to leave _FILE_OFFSET_BITS undefined. You should then 
be able to use stat64() and other 64-bit versions of the stdio functions. The 
normal functions remain 32-bit then. That also means that you have to use 
"struct stat64" instead of "struct stat".

Cheers,
Waldo
-- 
KDE 2.2: We deliver.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic