summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-14 18:46:55 +0800
committerMeco Man <[email protected]>2021-02-14 18:46:55 +0800
commitbb35f07bf2558bd655312926ea92a82b70e9274f (patch)
treedc92706b1555027d139f74508b61ac061982f6d1 /components
parent652d98bca60e94009211db081c012543ba4fd953 (diff)
implement _sys_tmpnam()
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/armlibc/syscalls.c (renamed from components/libc/compilers/armlibc/stubs.c)4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/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 <string.h>
@@ -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)