[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Determining if host is 64bit
From: |
David Boyce |
Subject: |
Re: Determining if host is 64bit |
Date: |
Fri, 8 Oct 2010 08:40:19 -0400 |
On Fri, Oct 8, 2010 at 8:32 AM, Paulo J. Matos <address@hidden> wrote:
> Eli Zaretskii <address@hidden> writes:
>
>>
>> On Windows, look up the PROCESSOR_ARCHITECTURE and
>> PROCESSOR_ARCHITEW6432 environment variables.
>
> Oh, excellent, thanks for letting me know. That was my biggest issue.
> On Linux I can parse `uname -m`.
For the record, in the Unix world there's mostly no such thing as a
"64-bit host", or at least the definition is slippery. For instance
Solaris goes both ways; it comes with both 32- and 64-bit versions of
all shared libraries and you can build and run programs of either
type.
Linux has the same basic design, but the policy differs between
distributions. Some "64-bit distributions" believe in purity and ship
only 64-bit libs, though the 32-bit versions can always be installed
manually. Others are so-called "multilib" distros which bundle both
kinds, thus behaving just like Solaris. Bottom line, on Linux the only
question that makes complete technical sense is "can I build and run
this particular program with this bitness at this time?"
More practically, though, most distros do self-identify as 32 or 64
and you've seen how to find that out via uname. You could also look
for the presence of /lib64. There's almost certainly something in
/proc which would tell you, you could run "file /bin/cat", etc.
David Boyce