Merge pull request #2250 from gztss/master

实现_sys_flen()函数并解决了unistd.h和dirent.h不能同时包含的问题。
This commit is contained in:
Bernard Xiong 2019-01-24 09:43:36 +08:00 committed by GitHub
commit a68bdc94e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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)