Changeset 340 for asp3_tinet_ecnl_rx/trunk/ntshell
- Timestamp:
- Apr 13, 2018, 1:00:30 PM (6 years ago)
- Location:
- asp3_tinet_ecnl_rx/trunk/ntshell
- Files:
-
- 7 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/ntshell/ntshell/usrcmd.c
r337 r340 790 790 } 791 791 792 int usrcmd_date(int argc, char **argv) 793 { 794 int ret; 795 struct timespec tp; 796 char buf[30]; 797 798 ret = shell_clock_gettime(CLOCK_REALTIME, &tp); 799 if (ret != 0) { 800 ntstdio_printf(&ntstdio, "clock_gettime error %d", ret); 801 return 0; 802 } 803 804 memset(buf, 0, sizeof(buf)); 805 if (ctime_r(&tp.tv_sec, buf) == NULL) { 806 ntstdio_printf(&ntstdio, "ctime_r error"); 807 return 0; 808 } 809 810 /* 改行コードの削除 */ 811 ret = ntlibc_strlen(buf); 812 buf[ret - 1] = '\0'; 813 814 ntstdio_printf(&ntstdio, "%s .%09u\n", buf, tp.tv_nsec); 815 return 0; 816 } 817 792 818 int usrcmd_info(int argc, char **argv) 793 819 { -
asp3_tinet_ecnl_rx/trunk/ntshell/ntshell/usrcmd.h
r337 r340 50 50 int usrcmd_mkdir(int argc, char **argv); 51 51 int usrcmd_hexdump(int argc, char **argv); 52 int usrcmd_date(int argc, char **argv); 52 53 53 54 int usrcmd_help(int argc, char **argv); -
asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.c
r337 r340 60 60 #include "core/ntlibc.h" 61 61 #include "util/ntstdio.h" 62 #include "ntp_cli.h" 62 63 #include "kernel_cfg.h" 63 64 … … 469 470 return 0; 470 471 } 472 473 int usrcmd_ntpc(int argc, char **argv) 474 { 475 ntp_cli_execute(); 476 return 0; 477 } -
asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c
r337 r340 125 125 { 126 126 const cmd_table_t *p = cmd_table_info.table; 127 int result = 0; 128 int found = 0; 129 127 130 if (strcmp((const char *)args[1], "help") == 0) { 128 usrcmd_help(args[0], (char **)&args[1]); 131 found = 1; 132 result = usrcmd_help(args[0], (char **)&args[1]); 129 133 } 130 134 else for (int i = 0; i < cmd_table_info.count; i++) { 131 135 if (strcmp((const char *)args[1], p->cmd) == 0) { 132 return p->func(args[0], (char **)&args[1]); 136 found = 1; 137 result = p->func(args[0], (char **)&args[1]); 138 break; 133 139 } 134 140 p++; 135 141 } 136 /*if (setjmp(process_exit) == 0) { 137 main(args); 138 }*/ 142 143 if ((found == 0) && (((const char *)args[1])[0] != '\0')) 144 printf("Unknown command found.\n"); 145 139 146 clean_fd(); 140 return 0; 147 148 return result; 141 149 } 142 150 -
asp3_tinet_ecnl_rx/trunk/ntshell/src/shellif.h
r337 r340 40 40 #ifdef _MSC_VER 41 41 #define _CRT_NO_TIME_T 42 #define tm msc_tm 42 43 #include <time.h> 43 44 #include <errno.h> 44 45 #include <limits.h> 45 46 #include <stdlib.h> 46 #define restrict __restrict 47 #undef tm 48 #undef NULL 47 49 #endif 48 50 … … 106 108 #include "../musl-1.1.18/include/bits/stat.h" 107 109 #include "../musl-1.1.18/include/sys/select.h" 110 #include "../musl-1.1.18/include/time.h" 108 111 #include "../musl-1.1.18/include/signal.h" 109 112 #include "../musl-1.1.18/include/stdio.h" -
asp3_tinet_ecnl_rx/trunk/ntshell/src/syscall.c
r337 r340 60 60 switch (n) { 61 61 case SYS__llseek: 62 return shell_llseek(va_arg(ap, int), ((va_arg(ap, off_t)) << 32) +va_arg(ap, off_t), va_arg(ap, off_t *), va_arg(ap, int));62 return shell_llseek(va_arg(ap, int), va_arg(ap, off_t), va_arg(ap, off_t *), va_arg(ap, int)); 63 63 case SYS__newselect: 64 64 ret = shell_select(va_arg(ap, int), va_arg(ap, fd_set *), va_arg(ap, fd_set *), va_arg(ap, fd_set *), va_arg(ap, struct timeval *)); … … 253 253 break; 254 254 case SYS_ftruncate64: 255 ret = shell_ftruncate(va_arg(ap, int), ((va_arg(ap, off_t)) << 32) +va_arg(ap, off_t));255 ret = shell_ftruncate(va_arg(ap, int), va_arg(ap, off_t)); 256 256 break; 257 257 case SYS_futex:
Note:
See TracChangeset
for help on using the changeset viewer.