uname -p -i 未知

uname -p -i 未知

为什么会发生这种情况?uname显示了所有可打印的内容。我不打算解决这个问题。甚至手册页也uname说这是一个常见的输出。

我只是想知道为什么。

答案1

POSIX没有定义-p-i。在GNUcoreutils它们被标记为不可移植,正如您所指出的那样。默认实现依赖于两个可选的操作系统功能,三参数形式sysinfo(2)(来自 SunOS)和六参数形式sysctl(3)(来自 BSD);这些在 Linux 上都不可用。

因此,在 Debian 和衍生发行版(除了 Ubuntu 及其衍生版本)上,您只需获得unknown.

在 Fedora 和相关发行版上,uname修补过的返回机器类型 ( -m) 作为处理器 ( -p) 和硬件平台 ( -i),后者经过调整以生成i386任何形式的值i?86

在 Ubuntu 及其衍生产品上,变体使用了 Fedora 补丁,它另外检查i686处理器上的 AMD CPU 并生成athlon

答案2

阅读info页面,它更详细:

'-我'

'--硬件平台'

 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'

' - 处理器'

 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.

相关内容