From 96b1046d1c68352677aa888cc110951a68daf155 Mon Sep 17 00:00:00 2001 From: Suriyan Ramasami Date: Mon, 17 Nov 2014 14:39:37 -0800 Subject: sandbox: Prepare API change for files greater than 2GB Change the internal sandbox functions to use loff_t for file offsets. Signed-off-by: Suriyan Ramasami Acked-by: Simon Glass --- include/os.h | 5 +++-- include/sandboxfs.h | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/os.h b/include/os.h index 0230a7f..e3645e0 100644 --- a/include/os.h +++ b/include/os.h @@ -217,9 +217,10 @@ const char *os_dirent_get_typename(enum os_dirent_t type); * Get the size of a file * * @param fname Filename to check - * @return size of file, or -1 if an error ocurred + * @param size size of file is returned if no error + * @return 0 on success or -1 if an error ocurred */ -ssize_t os_get_filesize(const char *fname); +int os_get_filesize(const char *fname, loff_t *size); /** * Write a character to the controlling OS terminal diff --git a/include/sandboxfs.h b/include/sandboxfs.h index e7c3262..8e5da6b 100644 --- a/include/sandboxfs.h +++ b/include/sandboxfs.h @@ -20,8 +20,10 @@ int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); -long sandbox_fs_read_at(const char *filename, unsigned long pos, - void *buffer, unsigned long maxsize); +int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer, + loff_t maxsize, loff_t *actread); +int sandbox_fs_write_at(const char *filename, loff_t pos, void *buffer, + loff_t maxsize, loff_t *actwrite); void sandbox_fs_close(void); int sandbox_fs_ls(const char *dirname); -- cgit v1.1