From 9596a94a8b05e16ead0d977a3f6ba0a812efb797 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 11 Apr 2019 14:21:05 +0800 Subject: [PATCH] =?UTF-8?q?[compilers/newlib]=20=E5=9C=A8=20syscalls.c=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=5F=5Ferrno=20()=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=9C=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20newlib=20=E7=BC=96=E8=AF=91=E6=97=B6=20errno=20?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0=20=5Frt?= =?UTF-8?q?=5Ferrno=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- components/libc/compilers/newlib/syscalls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 759feafe67..9919e11727 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -27,6 +27,14 @@ /* Reentrant versions of system calls. */ +#ifndef _REENT_ONLY +int * +__errno () +{ + return _rt_errno(); +} +#endif + int _close_r(struct _reent *ptr, int fd) {