[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: can one rely on uname -i results?



Dear Vladimir,

Vladimir Budnev wrote:
> While trying some opensource utility I'v found that one of launching
> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
> futher processing.

-i is for the ‘hardware platform’. You likely rather want to use
‘-m’, which gives the ‘machine hardware name’. While the naming
appears a little strange, the former is probably intended to give the
actual hardware architecture, whereas the latter gives the kernel
architecture.

An i386 kernel running on an amd64 CPU would hence give out ‘i386’ (or
something like that) when queried via -m, whereas ‘-i’, if available,
would have to say ‘x86_64’ – which doesn’t help at all, since the
kernel couldn’t run such code.

Best,

Claudius
-- 
Please don’t CC me.


Reply to: