Merge pull request #4339 from mysterywolf/exit

[libc][keil]实现_sys_tmpnam()函数
This commit is contained in:
Bernard Xiong 2021-02-15 23:43:32 +08:00 committed by GitHub
commit 06f47dafd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -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)