Changeset 9696b01 in mainline for uspace/lib/c
- Timestamp:
- 2014-11-14T17:25:28Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ab8539
- Parents:
- a047aaa
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/stats.c
ra047aaa r9696b01 316 316 void stats_print_load_fragment(load_t upper, unsigned int dec_length) 317 317 { 318 /* Magic value from BSD */319 load_t lower = 65536;320 321 318 /* Print the whole part */ 322 printf("%u.", upper / lower);323 324 load_t rest = (upper % lower) * 10;319 printf("%u.", upper / LOAD_UNIT); 320 321 load_t rest = (upper % LOAD_UNIT) * 10; 325 322 326 323 unsigned int i; 327 324 for (i = 0; i < dec_length; i++) { 328 printf("%u", rest / lower);329 rest = (rest % lower) * 10;325 printf("%u", rest / LOAD_UNIT); 326 rest = (rest % LOAD_UNIT) * 10; 330 327 } 331 328 } -
uspace/lib/c/include/stats.h
ra047aaa r9696b01 43 43 #include <abi/sysinfo.h> 44 44 45 #define LOAD_UNIT 65536 46 45 47 extern stats_cpu_t *stats_get_cpus(size_t *); 46 48 extern stats_physmem_t *stats_get_physmem(void);
Note:
See TracChangeset
for help on using the changeset viewer.