From e2dcefcb404df39fc38786f4b76e3b94d4f476e1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 25 Oct 2011 13:02:58 +0200 Subject: sandbox: add lseek helper Follow up patches want to be able to seek fd's. Acked-by: Simon Glass Signed-off-by: Mike Frysinger --- include/os.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/os.h') diff --git a/include/os.h b/include/os.h index c17a8a52ab..f74766d16c 100644 --- a/include/os.h +++ b/include/os.h @@ -48,6 +48,21 @@ ssize_t os_read(int fd, void *buf, size_t count); */ ssize_t os_write(int fd, const void *buf, size_t count); +/** + * Access to the OS lseek() system call + * + * \param fd File descriptor as returned by os_open() + * \param offset File offset (based on whence) + * \param whence Position offset is relative to (see below) + * \return new file offset + */ +off_t os_lseek(int fd, off_t offset, int whence); + +/* Defines for "whence" in os_lseek() */ +#define OS_SEEK_SET 0 +#define OS_SEEK_CUR 1 +#define OS_SEEK_END 2 + /** * Access to the OS open() system call * -- cgit v1.2.3