[issue11277] Crash with mmap and sparse files on Mac OS X
Ned Deily
report at bugs.python.org
Wed Jun 8 02:22:17 CEST 2011
Ned Deily <nad at acm.org> added the comment:
Victor, please do not use magic constants like that in C. The symbolic values are available in include files:
#include <CoreServices/CoreServices.h>
SInt32 major = 0;
SInt32 minor = 0;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);
if ((major == 10 && minor >= 7) || major >= 11) { ... }
(See, for instance, http://www.cocoadev.com/index.pl?DeterminingOSVersion and http://stackoverflow.com/questions/2115373/os-version-checking-in-cocoa. The code in platform and _gestalt.c could stand to be updated at some point.)
But, again, mmap should *not* be changed until 10.7 has been released and the Apple fix is verified and only if it makes sense to add the additional complexity.
----------
nosy: +ronaldoussoren
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11277>
_______________________________________
More information about the Python-bugs-list
mailing list