diff options
author | Alexander Aring <alex.aring@gmail.com> | 2013-02-17 22:05:01 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-20 08:22:42 +0100 |
commit | 9d8a20592fdc55be56add1639606b65e3cc523d1 (patch) | |
tree | b00eca00c6930954f213443fb990631dd2dd1110 /include/fs.h | |
parent | e48b1440715f7f25d664faf98f5afe0a787f7c68 (diff) | |
download | barebox-9d8a20592fdc55be56add1639606b65e3cc523d1.tar.gz barebox-9d8a20592fdc55be56add1639606b65e3cc523d1.tar.xz |
fs: add pread and pwrite functions
Add pread and pwrite functions.
Split read and write functions to save some space.
The functions pread and pwrite saves and sets the file
position to a given offset and restore them afterwards.
This also makes the nandtest command use these function
which is necessary to not break compilation for the nandtest
command.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
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 d6b22f71f1..7c4e46175a 100644 --- a/include/fs.h +++ b/include/fs.h @@ -114,8 +114,10 @@ int flush(int fd); int lstat(const char *filename, struct stat *s); int stat(const char *filename, struct stat *s); ssize_t read(int fd, void *buf, size_t count); +ssize_t pread(int fd, void *buf, size_t count, loff_t offset); int ioctl(int fd, int request, void *buf); ssize_t write(int fd, const void *buf, size_t count); +ssize_t pwrite(int fd, const void *buf, size_t count, loff_t offset); #define SEEK_SET 1 #define SEEK_CUR 2 |