From fec763384826dd661c776bb6260ab2a8eda9bafa Mon Sep 17 00:00:00 2001 From: bbahnsen Date: Thu, 26 Oct 2006 18:14:11 +0000 Subject: Implement a filelength function for GCC. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1847 6f19259b-4bc3-4df7-8a09-765794883524 --- Tools/CCode/Source/Common/CommonLib.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Tools/CCode/Source/Common/CommonLib.c') diff --git a/Tools/CCode/Source/Common/CommonLib.c b/Tools/CCode/Source/Common/CommonLib.c index 4d1663a55a..618abd89bb 100644 --- a/Tools/CCode/Source/Common/CommonLib.c +++ b/Tools/CCode/Source/Common/CommonLib.c @@ -495,6 +495,14 @@ Returns: } #ifdef __GNUC__ + +size_t _filelength(FILE *file) +{ + struct stat stat_buf; + fstat(fileno(file), &stat_buf); + return stat_buf.st_size; +} + #ifndef __CYGWIN__ char *strlwr(char *s) { -- cgit v1.2.3