Defined in rt_sys.h, the _sys_flen() function returns the current length of a file.
long _sys_flen(FILEHANDLE fh);
This function is used by _sys_seek() to convert an offset relative to the end of a file into an offset relative to the beginning of the file.
You do not have to define _sys_flen() if you do not intend to use fseek().
If you retarget at system _sys_*() level, you must supply _sys_flen(), even if the underlying system directly supports seeking relative to the end of a file.
This function returns the current length of the file fh, or a negative error indicator.