diff options
| author | Bernard Xiong <[email protected]> | 2019-01-29 04:28:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-29 04:28:40 +0800 |
| commit | b2c2958964d429775e3da335a4f6ca5b4f9e1671 (patch) | |
| tree | 25a2209ba4814d41b19e624a136ca1c7c894918f /components/libc/compilers/armlibc/stubs.c | |
| parent | dfebb30c91875c52f16fd4e7bb9e5981fd0512b4 (diff) | |
| parent | 8ff9b7795f0423eee36a19b2a36cec4e00c1e831 (diff) | |
Merge pull request #2289 from armink/lts-v3.1.xv3.1.2
Lts v3.1.x
Diffstat (limited to 'components/libc/compilers/armlibc/stubs.c')
| -rw-r--r-- | components/libc/compilers/armlibc/stubs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index 820daeff39..555108f712 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -265,7 +265,17 @@ void _sys_exit(int return_code) */ long _sys_flen(FILEHANDLE fh) { + struct stat stat; + + if (fh < STDERR) + return -1; + +#ifndef RT_USING_DFS return -1; +#else + fstat(fh, &stat); + return stat.st_size; +#endif } int _sys_istty(FILEHANDLE fh) |
