machine label.

Ralf Corsepius corsepiu at
Tue Nov 19 12:18:36 UTC 2002

Am Die, 2002-11-19 um 12.45 schrieb Chris Johns:
> Ralf Corsepius wrote:
> > Am Die, 2002-11-19 um 04.21 schrieb Chris Johns:
> >
> > >Does a define exist that describes the "machine" ?
> >
> > What do you mean by "machine", here? 
> I suppose it is the label returned by "uname -m" on FreeBSD or which 
> ever Unix.

Then POSIX's uname(2) is what you are looking for (cf.

> > architecture/cpu?
> > cpu-variant?
> > OS?
> > uname?
> >
> > There exist several defines and variables in RTEMS which could be used
> > for such purposes.
> This is what I was wondering. If it existed I would use it.
> > >This is for the global "extern char machine[];" that is found on 
> > FreeBSD boxes.
> >
> > This doesn't exist in RTEMS ;)
> Does in my code. I am porting the FreeBSD sysctl call :-)
Then I'd guess machine is an internal implementation detail of their
uname(2) implementation.

> > Do you want to destinguish RTEMS from other OSes?
> > Then you could use __rtems__ (defined by gcc).
> You may remotely via a protocol such as SNMP.
> It was a case of looking at what it takes to include these variables. If 
> it is not worth including that is fine.
It depends, to switch between code parts at compile-time, you can rely
on __rtems__, it is automatically provided by rtems-gccs, and is
supposed to be user provided if not using gcc.
If you want some string at run-time, using uname would be what you
should be using (It's standardized and should be portable).


More information about the users mailing list