]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lscpu: don't abort if cache size is unknown
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 26 Mar 2014 21:18:17 +0000 (22:18 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 27 Mar 2014 08:11:57 +0000 (09:11 +0100)
commit10d927ab3ba442084283db670364045bca61dbb8
treeec2e95e2f0633e56edd9113a4515ce5a924d2b6a
parent9c721310657de9573a22a8acad3926d47f83deaf
lscpu: don't abort if cache size is unknown

There are systems where the size file does not exist. Most badly even
lscpu -p would abort allthough it does not use the size:
$ lscpu -p
lscpu: error: cannot open
/sys/devices/system/cpu/cpu0/cache/index0/size: No such file or directory

This patch does not abort in this case and prints "unknown size" in
human-readable case. For examle on this qemu pcc test machine:
$ lscpu
Architecture:          ppc
CPU op-mode(s):        32-bit
Byte Order:            Big Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Model:                 Power Macintosh
BogoMIPS:              33.25
L1d cache:             unknown size
L1i cache:             unknown size

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/lscpu.c