From 9cf65d0b2823a6a6f8fd606180ef971b6b1616dc Mon Sep 17 00:00:00 2001 From: heyuanjie Date: Wed, 1 Aug 2018 15:44:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lwp/lwp_syscall.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index d52c3d09f6..b7c54e4e36 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -26,6 +26,15 @@ #include #include +#include +#if (defined(RT_USING_SAL) && defined(SAL_USING_POSIX)) +#include + +#define SYSCALL_NET(f) (f) +#else +#define SYSCALL_NET(f) (sys_notimpl) +#endif + #define DBG_ENABLE #define DBG_SECTION_NAME "LWP_CALL" #define DBG_COLOR @@ -204,6 +213,11 @@ int sys_fstat(int file, struct stat *buf) return fstat(file, buf); } +int sys_notimpl(void) +{ + return -ENOSYS; +} + const static void* func_table[] = { (void *)sys_exit, // 0x01 @@ -226,11 +240,26 @@ const static void* func_table[] = (void *)sys_free, // 0x0e (void *)sys_realloc, //0x0f (void *)sys_fstat, // 0x10 + poll, // 0x11 + + SYSCALL_NET(accept), // 0x12 + SYSCALL_NET(bind), // 0x13 + SYSCALL_NET(shutdown), // 0x14 + SYSCALL_NET(getpeername),// 0x15 + SYSCALL_NET(getsockname),// 0x16 + SYSCALL_NET(getsockopt), // 0x17 + SYSCALL_NET(setsockopt), // 0x18 + SYSCALL_NET(connect), // 0x19 + SYSCALL_NET(listen), // 0x1a + SYSCALL_NET(recv), // 0x1b + SYSCALL_NET(recvfrom), // 0x1c + SYSCALL_NET(send), // 0x1d + SYSCALL_NET(sendto), // 0x1e }; const void *lwp_get_sys_api(rt_uint32_t number) { - const void *func = RT_NULL; + const void *func = sys_notimpl; if (number == 0xff) { From 43f718961e855a759dd678c13a7808aef5f8f9ce Mon Sep 17 00:00:00 2001 From: heyuanjie Date: Wed, 1 Aug 2018 17:03:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E7=BB=9Csyscall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lwp/lwp_syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index b7c54e4e36..1b5aa411aa 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -255,6 +255,7 @@ const static void* func_table[] = SYSCALL_NET(recvfrom), // 0x1c SYSCALL_NET(send), // 0x1d SYSCALL_NET(sendto), // 0x1e + SYSCALL_NET(socket), // 0x1f }; const void *lwp_get_sys_api(rt_uint32_t number)