[Python-bugs-list] [ python-Bugs-621523 ] sizeof(struct stat) changes

noreply@sourceforge.net noreply@sourceforge.net
Thu, 10 Oct 2002 15:22:41 -0700


Bugs item #621523, was opened at 2002-10-10 15:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=621523&group_id=5470

>Category: Python Interpreter Core
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: sizeof(struct stat) changes

Initial Comment:
Including Python.h changes sizeof(struct stat):

ralf@gandalf:~$ cat t.c
#ifdef USE_PYTHON
#include <Python.h>
#endif

#include <sys/stat.h>

main()
{
        printf ("sizeof=%d\n", sizeof(struct stat));
}
ralf@gandalf:~$ gcc t.c -I/usr/include/python2.2
-DUSE_PYTHON && ./a.out 
sizeof=96
ralf@gandalf:~$ gcc t.c && ./a.out 
sizeof=88
ralf@gandalf:~$ uname -a
Linux gandalf 2.4.18 #3 Thu Feb 28 16:29:52 CET 2002
i686 unknown

rechecked with gcc-3.2 and current HEAD.
Platform tests is Debian woody and Debian unstable.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-10-10 18:22

Message:
Logged In: YES 
user_id=33168

The problem is that Python is built with large file support.
 I'm running RedHat and your example works the same for me.
 It appears that _LARGEFILE64_SOURCE (_LARGEFILE_SOURCE on
my system) is defined in pyconfig.h.  So __USE_FILE_OFFSET64
gets defined in /usr/include/features.h.

Python can be built without large file support, in which
case the size will not change.

Is this really a problem?  Can it be solved by removing
large file support from python?  Can you include
<sys/stat.h> before including Python.h to solve the problem?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=621523&group_id=5470