Detecting 64bit vs. 32bit Linux

Robin Becker robin at reportlab.com
Mon Jul 10 09:21:10 EDT 2006


Michael Yanowitz wrote:
......
> 
>> I need to detect whether the operating system I am running on (not the 
>> Python version) is 64bit or 32bit. One requirement is that I need to 
>> include support for non-Intel/AMD architectures.
> 
> The standard C way would be to check sizeof(void *).
so on those old ARM RISC OSes with 32 bit arithmetic would I get sizeof(void *) 
== 4 when the address bus was 26 bits wide? Seems a bit naive to assume the 
address bus will always be the same width as the registers, but I guess the 
compilers have to do something.

I seem to remember some compilers allowing pure 32 bit addressing on 8088 
machines (with 16 bit registers), but I think the M$ compilers all had near and 
far pointer mechanisms to help you get confused.
-mumbling-ly yrs-
Robin Becker




More information about the Python-list mailing list