diff options
| author | MurphyZhao <[email protected]> | 2019-04-11 14:21:05 +0800 |
|---|---|---|
| committer | MurphyZhao <[email protected]> | 2019-04-11 14:24:36 +0800 |
| commit | 9596a94a8b05e16ead0d977a3f6ba0a812efb797 (patch) | |
| tree | 8c9469f999f97a63976d9c7d8273b4f4e376ec82 /components/libc/compilers | |
| parent | ec6118d46a84c19eaeb8f57363941415ef15fb90 (diff) | |
[compilers/newlib] 在 syscalls.c 增加 __errno () 函数实现,解决在使用 newlib 编译时 errno 无法重定向到 _rt_errno 的问题
Signed-off-by: MurphyZhao <[email protected]>
Diffstat (limited to 'components/libc/compilers')
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |
