6 use Linux::SysInfo qw/sysinfo LS_HAS_EXTENDED/;
9 die 'sysinfo() failed ! (should be pretty rare but it did happen)' unless $si;
11 print 'Extended fields are ', (LS_HAS_EXTENDED ? '' : 'NOT '), "available on your system.\n\n";
14 print "- $_: $si->{$_}\n" for sort keys %$si;
16 if (LS_HAS_EXTENDED) {
18 print 'You have the mem_unit field set to ', $si->{mem_unit}, ', hence ',
19 ($si->{mem_unit} == 1) ? "the memory values are the actual sizes in bytes :\n"
20 : "the sizes in bytes are actually :\n";
21 print '- ', $_, ': ', $si->{$_} * $si->{mem_unit}, "\n" for sort
22 qw/totalram freeram sharedram bufferram totalswap freeswap totalhigh freehigh/;