diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-20 13:43:27 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-20 13:43:27 +0000 |
commit | 7587cf44019d593bb12703e7046bd7738996c55c (patch) | |
tree | dd23aa84ab6f33037c5f6c5a165d25ffeaf22a8b /vl.c | |
parent | 70867490723b3a5b342f95ff9fa496376f0b0dd7 (diff) |
accept bigger PC BIOSes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@946 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -291,6 +291,18 @@ char *pstrcat(char *buf, int buf_size, const char *s) } /* return the size or -1 if error */ +int get_image_size(const char *filename) +{ + int fd, size; + fd = open(filename, O_RDONLY | O_BINARY); + if (fd < 0) + return -1; + size = lseek(fd, 0, SEEK_END); + close(fd); + return size; +} + +/* return the size or -1 if error */ int load_image(const char *filename, uint8_t *addr) { int fd, size; |