Changeset 4b662f8c in mainline for kernel/generic/src/console/cmd.c
- Timestamp:
- 2007-04-20T18:43:49Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ea63704
- Parents:
- cc85fb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
rcc85fb9 r4b662f8c 93 93 }; 94 94 95 static int cmd_uptime(cmd_arg_t *argv); 96 static cmd_info_t uptime_info = { 97 .name = "uptime", 98 .description = "Print uptime information.", 99 .func = cmd_uptime, 100 .argc = 0 101 }; 102 95 103 static int cmd_continue(cmd_arg_t *argv); 96 104 static cmd_info_t continue_info = { … … 440 448 &exit_info, 441 449 &reboot_info, 450 &uptime_info, 442 451 &halt_info, 443 452 &help_info, … … 530 539 } 531 540 541 542 /** Print system uptime information. 543 * 544 * @param argv Argument vector. 545 * 546 * @return 0 on failure, 1 on success. 547 */ 548 int cmd_uptime(cmd_arg_t *argv) 549 { 550 ASSERT(uptime); 551 552 /* This doesn't have to be very accurate */ 553 unative_t sec = uptime->seconds1; 554 555 printf("Up %u days, %u hours, %u minutes, %u seconds\n", 556 sec / 86400, (sec % 86400) / 3600, (sec % 3600) / 60, sec % 60); 557 558 return 1; 559 } 560 532 561 /** Describe specified command. 533 562 *
Note:
See TracChangeset
for help on using the changeset viewer.