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

Anders Nygren anders.nygren@REDACTED
Sat Jun 2 01:36:26 CEST 2007


On 6/1/07, Emad El-Haraty <emad@REDACTED> wrote:
> begin Logan, Martin quotation:
> > Let me rephrase my ambiguous request and elaborate.  I am looking for a
> > library written in Erlang that will allow me to determine the
> > architecture of a system in such a way as to ensure that C code
> > previously compiled for that architecture class will run on it.
> >
> >
>
>
>
> 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


/Anders



More information about the erlang-questions mailing list