1
0
Fork 0
forked from len0rd/rockbox

Added the filesize() function

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3473 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2003-03-18 00:39:57 +00:00
parent 55fc6df874
commit e98bad5b38
6 changed files with 36 additions and 0 deletions

View file

@ -591,3 +591,15 @@ int lseek(int fd, int offset, int whence)
return pos;
}
int filesize(int fd)
{
struct filedesc* file = &openfiles[fd];
if ( !file->busy ) {
errno = EBADF;
return -1;
}
return file->size;
}

View file

@ -64,6 +64,7 @@ extern int write(int fd, void* buf, int count);
extern int remove(const char* pathname);
extern int rename(const char* path, const char* newname);
extern int ftruncate(int fd, unsigned int size);
extern int filesize(int fd);
#endif /* SIMULATOR */
#endif /* __MINGW32__ */