[erlang-questions] Determine architecture - the erlang way??

Logan, Martin Martin.Logan@REDACTED
Tue Jun 5 20:32:08 CEST 2007


>
> Would using some combination of
> erlang:system_info(system_architecture)
> erlang:system_info(hipe_architecture)
> work ?
>
> The output on various systems:
> 1> erlang:system_info(system_architecture).
> "i686-pc-linux-gnu"
>
> 1> erlang:system_info(system_architecture).
> "i386-unknown-freebsd6.2"
>
> 1> erlang:system_info(system_architecture).
> "i386-apple-darwin8.8.1"
>
>

There is also

1> os:type().
{unix,sunos}
2> os:version().
{5,10,0}
3> erlang:system_info(system_architecture).
"i386-pc-solaris2.10"

This on an AMD64 something.
-bash-3.00$ uname -a
SunOS suny 5.10 Generic_118855-14 i86pc i386 i86pc


This is what we are currently using in the code, also, for os versions
that use glibc we are using Erlang:system_info(allocator) to grab the
version for glibc and tack it onto the result from erlang system info.
For mac and bsd flavors there is no glibc version for allocator so I am
just using the naked string from system_architecture. I want to make
this as general as possible while still functioning in 99% of cases.
Any ideas on where to draw that line are appreciated.  I am in the
process of testing.  Thanks for your input. 

Cheers,
Martin 





More information about the erlang-questions mailing list