From e98bad5b386d58a6add0b7db31ea7090cb791b55 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 18 Mar 2003 00:39:57 +0000 Subject: Added the filesize() function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3473 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/x11/io.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'uisimulator/x11/io.c') diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c index bc9c99fa10..c33a42d636 100644 --- a/uisimulator/x11/io.c +++ b/uisimulator/x11/io.c @@ -156,6 +156,15 @@ int x11_rename(char *oldpath, char* newpath) return -1; } +int x11_filesize(int fd) +{ + int old = lseek(fd, 0, SEEK_CUR); + int size = lseek(fd, 0, SEEK_END); + lseek(fd, old, SEEK_SET); + + return(size); +} + void fat_size(unsigned int* size, unsigned int* free) { struct statfs fs; -- cgit v1.2.3