Changeset bd41ac52 in mainline for uspace/app/top
- Timestamp:
- 2018-08-25T22:21:25Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cca80a2
- Parents:
- e2625b1a
- Location:
- uspace/app/top
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/screen.c
re2625b1a rbd41ac52 49 49 #include "top.h" 50 50 51 #define USEC_COUNT 1000000 52 53 static suseconds_t timeleft = 0; 51 static usec_t timeleft = 0; 54 52 55 53 console_ctrl_t *console; … … 57 55 static sysarg_t warning_col = 0; 58 56 static sysarg_t warning_row = 0; 59 static suseconds_t warning_timeleft = 0;57 static usec_t warning_timeleft = 0; 60 58 static char *warning_text = NULL; 61 59 … … 179 177 static inline void print_global_head(data_t *data) 180 178 { 181 printf("top - %02l u:%02lu:%02luup "179 printf("top - %02lld:%02lld:%02lld up " 182 180 "%" PRIun " days, %02" PRIun ":%02" PRIun ":%02" PRIun ", " 183 181 "load average:", … … 527 525 va_end(args); 528 526 529 warning_timeleft = 2 * USEC_COUNT;527 warning_timeleft = SEC2USEC(2); 530 528 531 529 screen_moveto(warning_col, warning_row); … … 537 535 * 538 536 */ 539 int tgetchar( unsigned int sec)537 int tgetchar(sec_t sec) 540 538 { 541 539 /* … … 544 542 545 543 if (timeleft <= 0) 546 timeleft = sec * USEC_COUNT;544 timeleft = SEC2USEC(sec); 547 545 548 546 /* -
uspace/app/top/screen.h
re2625b1a rbd41ac52 47 47 _HELENOS_PRINTF_ATTRIBUTE(1, 2); 48 48 49 extern int tgetchar( unsigned int);49 extern int tgetchar(sec_t); 50 50 51 51 #endif -
uspace/app/top/top.c
re2625b1a rbd41ac52 39 39 #include <stdlib.h> 40 40 #include <task.h> 41 #include < sys/time.h>41 #include <time.h> 42 42 #include <errno.h> 43 43 #include <gsort.h> … … 154 154 155 155 /* Get current time */ 156 struct time valtime;157 get timeofday(&time, NULL);156 struct timespec time; 157 getrealtime(&time); 158 158 159 159 target->hours = (time.tv_sec % DAY) / HOUR; … … 162 162 163 163 /* Get uptime */ 164 struct time valuptime;164 struct timespec uptime; 165 165 getuptime(&uptime); 166 166
Note:
See TracChangeset
for help on using the changeset viewer.