Comment 1 for bug 111863

Revision history for this message
Micah Cowan (micahcowan) wrote :

Thank you for your bug report.

This behavior is according to the documentation. Under the descriptions for both "-i" and "-p", it states, "Print `unknown' if the kernel does not make this information easily available, as is the case with Linux kernels."

Most of the values for options given to the uname command come from a call to uname(). The "-i" and "-p" options, though, are not defined in POSIX (and so aren't portable). Some systems, especially BSD, provide additional, separate information for these concepts of "hardware architecture" or "processor type", and print these values obtained from a special system call, either sysinfo() or sysctl(). Linux, however, does not offer the BSD-style sysinfo() (it has an entirely different system call named sysinfo()); and it does not offer a value for the HW_MODEL or HW_MACHINE_ARCH in sysctl().

So, these options are extensions, provided to take advantage of some more-or-less BSD-specific features. Rather than just give an error when these options are used on OSses that don't support them, as they could have done, they opted to have them print "unknown" instead.

The "-m" option, on the other hand, is extremely portable, and may be depended upon to give reliable results.