On Fri, Jan 02, 2004 at 06:40:58PM +0000, Torsten Werner wrote: > On 2004-01-02, Matthew Wilcox wrote: > > Now that I look into it, wxwindows is the culprit because the idiots > > define off_t *themselves*! Look at /usr/include/wx/filefn.h : > > > > // define off_t > > #if !defined(__WXMAC__) || defined(__UNIX__) > > #include <sys/types.h> > > #else > > typedef long off_t; > > #endif > > Argh! But the result is correct. 'typedef long off_t' gives the same > result as including <sys/types.h> and it does not explain why the > binaries used a 'typedef long long off_t'.
Nope. It's convoluted; bear with me: sys/types.h: # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif bits/types.h: __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ bits/typesizes.h: #define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE back to bits/types.h again: #define __SLONGWORD_TYPE long int # define __SQUAD_TYPE long long int So off_t is 'long int' if __USE_FILE_OFFSET64 is not defined and 'long long int' if it is. Using -D_FILE_OFFSET_BITS=64 causes __USE_FILE_OFFSET64 to be defined. -- "Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain

