Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/stats.c

    rd4d74dc r1ab8539  
    291291}
    292292
    293 /** Get system uptime
    294  *
    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 
    307293/** Print load fixed-point value
    308294 *
     
    316302void stats_print_load_fragment(load_t upper, unsigned int dec_length)
    317303{
    318         /* Magic value from BSD */
    319         load_t lower = 65536;
    320        
    321304        /* 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;
    325308       
    326309        unsigned int i;
    327310        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;
    330313        }
    331314}
Note: See TracChangeset for help on using the changeset viewer.