tcl-mod_dtcl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject insidious stat vs stat64 bug on Linux
Date Sat, 05 Jan 2002 18:41:30 GMT

[ sorry for the crossposting - is everyone who needs to be on general@
? ]

Observe:

FILE 1

#include "httpd.h"
#include <tcl.h>

int main() {
    struct stat foo;
    printf("size of stat __pad1 is %d\n", sizeof(foo.__pad1));
}

FILE 2

#include <tcl.h>
#include "httpd.h"

int main() {
    struct stat foo;
    printf("size of stat __pad1 is %d\n", sizeof(foo.__pad1));
}

These are *different*, because, at least on my box, running Linux
2.4.16 on a PowerPC system, #define _FILE_OFFSET_BITS 64 is set by the
Apache config files.

so the first is really a stat64 struct, and the second a regular old
stat struct.

I'm not sure of all of the ramifications of this, but I spent a long
time even finding it, and think that it might cause some very subtle
and nasty bugs.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Mime
View raw message