home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] what is the "uname" variation that shows a 32-bit install on 64-bit system?

  • Subject: Re: [OCLUG-Tech] what is the "uname" variation that shows a 32-bit install on 64-bit system?
  • From: Bart Trojanowski <bart [ at ] jukie [ dot ] ca>
  • Date: Mon, 9 May 2011 03:41:03 +0000
2011/5/9 Peter Sjöberg <lpaseen [ at ] gmail [ dot ] com>
>
>
> On 05/06/2011 02:49 PM, Bart Trojanowski wrote:
> > On Fri, May 6, 2011 at 18:24, Richard Guy Briggs <rgb [ at ] tricolour [ dot ] net> wrote:
> >
> >> Not quite what you intended, but how about:
> >>        file $(which uname)
> >>
> > I often do exactly this with '/bin/ls' to test the OS bitness.
> >
> > Another alternative is to use gcc -dumpmachine ... which is available on all
> > systems that matter :-)
>
> What am I missing?

Not sure.

Richard and I both thought that Rob was asking about the userland
bitness, as opposed to the kernel bitness.  Uname is fine, as long as
you assume the user isn't running a 64bit kernel and 32bit userland.

Also, using uname cannot be trusted in some situations, say if you're
building for a 32bit target in a chroot (and didn't run with linux32).

This is something that should probably be part of LSB (lsb_release
command), but isn't.

-Bart