소스 검색

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

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 7 년 전
부모
커밋
9596a94a8b
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  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)
 {