Changeset 433 for EcnlProtoTool/trunk/ntshell/ntshell/usrcmd.c
- Timestamp:
- Jul 5, 2020, 9:26:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/ntshell/usrcmd.c
r424 r433 789 789 } 790 790 791 int usrcmd_date(int argc, char **argv) 792 { 793 int ret; 794 struct timespec tp; 795 char buf[30]; 796 797 ret = shell_clock_gettime(CLOCK_REALTIME, &tp); 798 if (ret != 0) { 799 ntstdio_printf(&ntstdio, "clock_gettime error %d", ret); 800 return 0; 801 } 802 803 memset(buf, 0, sizeof(buf)); 804 if (ctime_r(&tp.tv_sec, buf) == NULL) { 805 ntstdio_printf(&ntstdio, "ctime_r error"); 806 return 0; 807 } 808 809 /* 改行コードの削除 */ 810 ret = ntlibc_strlen(buf); 811 buf[ret - 1] = '\0'; 812 813 ntstdio_printf(&ntstdio, "%s .%09ld\n", buf, tp.tv_nsec); 814 return 0; 815 } 816 791 817 int usrcmd_info(int argc, char **argv) 792 818 {
Note:
See TracChangeset
for help on using the changeset viewer.