unix.linux.proc: Fix length of meminfo struct on some kernel versions.

db4
Doug Coleman 2014-04-22 00:18:20 -07:00
parent 9780012f55
commit d1d15f83c4
1 changed files with 3 additions and 1 deletions

View File

@ -182,10 +182,12 @@ TUPLE: proc-meminfo
direct-map-4k
direct-map-2m ;
! Different kernels have fewer fields. Make sure we have enough.
: parse-proc-meminfo ( -- meminfo )
"/proc/meminfo" utf8 file-lines [
" " split harvest second string>number 1024 *
] map [ proc-meminfo boa ] input<sequence ;
] map
50 f pad-tail [ proc-meminfo boa ] input<sequence ;
! All cpu-stat fields are measured in jiffies.
TUPLE: proc-stat