diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-03-18 17:59:46 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-20 08:42:46 +0200 |
commit | 2d2ec6619b84fd70ceaa5f4a347c428ff24339ad (patch) | |
tree | 09d43c20189826110822f3bb3b33ab78483804cf /include/fs.h | |
parent | 1e2cc039145bf41c1472eb17411622642017bac0 (diff) | |
download | barebox-2d2ec6619b84fd70ceaa5f4a347c428ff24339ad.tar.gz barebox-2d2ec6619b84fd70ceaa5f4a347c428ff24339ad.tar.xz |
read_file: Make it work on tftp servers which do not pass size
Some tftp servers (for example netkit-tftp) do not pass the filesize.
Add a workaround for read_file which reads the file into a temporary
file which then is copied to a buffer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/fs.h')
-rw-r--r-- | include/fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/fs.h b/include/fs.h index 7c4e46175a..22c07467da 100644 --- a/include/fs.h +++ b/include/fs.h @@ -149,6 +149,8 @@ int protect(int fd, size_t count, unsigned long offset, int prot); int protect_file(const char *file, int prot); void *memmap(int fd, int flags); +#define FILESIZE_MAX ((loff_t)-1) + #define PROT_READ 1 #define PROT_WRITE 2 |