diff options
| author | Bernard Xiong <[email protected]> | 2021-02-15 23:43:32 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-15 23:43:32 +0800 |
| commit | 06f47dafd25e396787dffaecc777fe1210b4a82b (patch) | |
| tree | a10b63a5ce4157ad2e232f70382702fe1af24946 /components/libc | |
| parent | 91d29c33db1bde70809e5ce78ee898ec0e4f3234 (diff) | |
| parent | c4d11f52dd2170396c902392582016d2c7624c3b (diff) | |
Merge pull request #4339 from mysterywolf/exit
[libc][keil]实现_sys_tmpnam()函数
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/armlibc/syscalls.c (renamed from components/libc/compilers/armlibc/stubs.c) | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/syscalls.c index ed328e20e3..1e08ca1716 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -12,16 +12,17 @@ * 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 <string.h> #include <rt_sys.h> -#include "rtthread.h" +#include <rtthread.h> #include "libc.h" #ifdef RT_USING_DFS -#include "dfs_posix.h" +#include <dfs_posix.h> #endif #ifdef __CLANG_ARM @@ -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) |
