diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/file.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index d2cad7c647..8c0f9a8951 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -591,3 +591,15 @@ int lseek(int fd, int offset, int whence) | |||
591 | 591 | ||
592 | return pos; | 592 | return pos; |
593 | } | 593 | } |
594 | |||
595 | int filesize(int fd) | ||
596 | { | ||
597 | struct filedesc* file = &openfiles[fd]; | ||
598 | |||
599 | if ( !file->busy ) { | ||
600 | errno = EBADF; | ||
601 | return -1; | ||
602 | } | ||
603 | |||
604 | return file->size; | ||
605 | } | ||