Browse Source

[compilers/newlib] 在 syscalls.c 增加 __errno () 函数实现,解决在使用 newlib 编译时 errno 无法重定向到 _rt_errno 的问题

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 6 years ago
parent
commit
9596a94a8b
1 changed files with 8 additions and 0 deletions
  1. 8 0
      components/libc/compilers/newlib/syscalls.c

+ 8 - 0
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)
 {