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:
parent
55fc6df874
commit
e98bad5b38
6 changed files with 36 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue