uname -p -i are unknown

Why does this happen? Everything else printable with uname is shown.
I am not looking into fixing this. Even the manual page of uname says that it’s a common output.

I just want to know why.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

POSIX doesn’t define -p or -i. In GNU coreutils they are marked as non-portable, as you indicate. The default implementation relies on two optional operating system features, the three-argument form of sysinfo(2) (from SunOS) and the six-argument form of sysctl(3) (from the BSDs); neither of these are available on Linux.

Thus on Debian and derived distributions (apart from Ubuntu and its derivatives), you simply get unknown.

On Fedora and related distributions, uname is patched to return the machine type (-m) as processor (-p) and hardware platform (-i), with the latter tweaked to produce i386 for any value of the form i?86.

On Ubuntu and derivatives, a variant of the Fedora patch is used, which additionally checks for AMD CPUs on i686 processors and produces athlon instead.

Method 2

Read the info page, it is more detailed:

‘-i’

‘–hardware-platform’

 Print the hardware platform name (sometimes called the hardware
 implementation).  Print ‘unknown’ if the kernel does not make this
 information easily available, as is the case with Linux kernels.

‘-p’

‘–processor’

 Print the processor type (sometimes called the instruction set
 architecture or ISA). Print ‘unknown’ if the kernel does not make
 this information easily available, as is the case with Linux
 kernels.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x