[Python-Dev] Python and POSIX

Marc Recht recht at netbsd.org
Mon Sep 15 17:07:59 EDT 2003


Currently Python configure process sets quite a few POSIX/XOPEN macros (eg. 
_POSIX_C_SOURCE/_XOPEN_SOURCE) to archieve portability. The is a good thing 
- for the interpreter. The problem with this is that these macros are 
exported to Python extensions via pyconfig.h. That way every extension 
which uses pyconfig.h is limited to POSIX/XOPEN functionality and not all 
library features of the OS (eg. RPC) are available for the extension. For 
the systems that supported it the Python configure process also sets macros 
which activate all library functions (_NETBSD_SOURCE, __EXTENSIONS__) and 
thus avoiding POSIX as a work-around. On all systems I'm aware of this is 
the same feature-set you get if you don't set any macro at all, but 
unfortunately not all systems support such a macro.
So, why not split pyconfig.h up into an external and internal header? That 
way the the interpreter could be POSIX confirming (which is indeed a good 
thing) without enforcing POSIX to the extensions.


More information about the Python-Dev mailing list