Changes in uspace/lib/c/generic/stats.c [d4d74dc:1ab8539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/stats.c
rd4d74dc r1ab8539 291 291 } 292 292 293 /** Get system uptime294 *295 * @return System uptime (in seconds).296 *297 */298 sysarg_t stats_get_uptime(void)299 {300 sysarg_t uptime;301 if (sysinfo_get_value("system.uptime", &uptime) != EOK)302 uptime = 0;303 304 return uptime;305 }306 307 293 /** Print load fixed-point value 308 294 * … … 316 302 void stats_print_load_fragment(load_t upper, unsigned int dec_length) 317 303 { 318 /* Magic value from BSD */319 load_t lower = 65536;320 321 304 /* Print the whole part */ 322 printf("%u.", upper / lower);323 324 load_t rest = (upper % lower) * 10;305 printf("%u.", upper / LOAD_UNIT); 306 307 load_t rest = (upper % LOAD_UNIT) * 10; 325 308 326 309 unsigned int i; 327 310 for (i = 0; i < dec_length; i++) { 328 printf("%u", rest / lower);329 rest = (rest % lower) * 10;311 printf("%u", rest / LOAD_UNIT); 312 rest = (rest % LOAD_UNIT) * 10; 330 313 } 331 314 }
Note:
See TracChangeset
for help on using the changeset viewer.