From bb35f07bf2558bd655312926ea92a82b70e9274f Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 14 Feb 2021 18:46:55 +0800 Subject: [PATCH 1/2] implement _sys_tmpnam() --- components/libc/compilers/armlibc/{stubs.c => syscalls.c} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename components/libc/compilers/armlibc/{stubs.c => syscalls.c} (98%) diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/syscalls.c similarity index 98% rename from components/libc/compilers/armlibc/stubs.c rename to components/libc/compilers/armlibc/syscalls.c index ed328e20e3..e0f06b2214 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -12,6 +12,7 @@ * 2020-08-05 Meco Man fixed _sys_flen() compiling-warning when * RT_USING_DFS is not defined * 2020-02-13 Meco Man re-implement exit() and abort() + * 2020-02-14 Meco Man implement _sys_tmpnam() */ #include @@ -234,7 +235,8 @@ int _sys_seek(FILEHANDLE fh, long pos) */ int _sys_tmpnam(char *name, int fileno, unsigned maxlength) { - return -1; + rt_snprintf(name, maxlength, "tem%03d", fileno); + return 1; } char *_sys_command_string(char *cmd, int len) From c4d11f52dd2170396c902392582016d2c7624c3b Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 14 Feb 2021 18:47:48 +0800 Subject: [PATCH 2/2] update --- components/libc/compilers/armlibc/syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index e0f06b2214..1e08ca1716 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -18,11 +18,11 @@ #include #include -#include "rtthread.h" +#include #include "libc.h" #ifdef RT_USING_DFS -#include "dfs_posix.h" +#include #endif #ifdef __CLANG_ARM