From 3824f742ba0841dbbb2bd304377f798acdba28d4 Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Thu, 24 Nov 2022 11:19:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[armlibc]=20=E4=BF=AE=E5=A4=8DAC6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=87=B36.19=E5=90=8E=5Fsys=5Ftmpnam()=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/armlibc/syscalls.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 26ba3796fa4..0654be62262 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -282,11 +282,18 @@ int _sys_seek(FILEHANDLE fh, long pos) /** * used by tmpnam() or tmpfile() */ +#if __ARMCC_VERSION >= 6190000 +void _sys_tmpnam(char *name, int fileno, unsigned maxlength) +{ + rt_snprintf(name, maxlength, "tem%03d", fileno); +} +#else int _sys_tmpnam(char *name, int fileno, unsigned maxlength) { rt_snprintf(name, maxlength, "tem%03d", fileno); return 1; } +#endif char *_sys_command_string(char *cmd, int len) { From f69c9d0d5d57c5a31a7d9615ac5a7f6507385cb0 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Wed, 23 Nov 2022 22:44:36 -0500 Subject: [PATCH 2/2] Update syscalls.c --- components/libc/compilers/armlibc/syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 0654be62262..74097da58f7 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -293,7 +293,7 @@ int _sys_tmpnam(char *name, int fileno, unsigned maxlength) rt_snprintf(name, maxlength, "tem%03d", fileno); return 1; } -#endif +#endif /* __ARMCC_VERSION >= 6190000 */ char *_sys_command_string(char *cmd, int len) {