@@ -75,9 +75,10 @@ int64_t get_image_size(const char *filename)
/* return the size or -1 if error */
/* deprecated, because caller does not specify buffer size! */
-int load_image(const char *filename, uint8_t *addr)
+ssize_t load_image(const char *filename, uint8_t *addr)
{
- int fd, size;
+ int fd;
+ ssize_t size;
fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
return -1;
@@ -11,7 +11,7 @@
* On error, errno is also set as appropriate.
*/
int64_t get_image_size(const char *filename);
-int load_image(const char *filename, uint8_t *addr); /* deprecated */
+ssize_t load_image(const char *filename, uint8_t *addr); /* deprecated */
ssize_t load_image_size(const char *filename, void *addr, size_t size);
/**load_image_targphys_as:
This patch allow load_iamge to load >=2G file Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> --- hw/core/loader.c | 5 +++-- include/hw/loader.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)