From patchwork Mon Jan 23 06:30:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 137264 X-Patchwork-Delegate: vapier@gentoo.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id F3461B6FA2 for ; Mon, 23 Jan 2012 17:30:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8EC662819F; Mon, 23 Jan 2012 07:30:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nrhJwEaz+W+r; Mon, 23 Jan 2012 07:30:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C0FBF28187; Mon, 23 Jan 2012 07:30:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2906A2816E for ; Mon, 23 Jan 2012 07:30:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AW19EOSdFdb5 for ; Mon, 23 Jan 2012 07:30:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by theia.denx.de (Postfix) with ESMTPS id A1A552808A for ; Mon, 23 Jan 2012 07:30:10 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E77931B4026; Mon, 23 Jan 2012 06:30:03 +0000 (UTC) From: Mike Frysinger To: u-boot@lists.denx.de Date: Mon, 23 Jan 2012 01:30:23 -0500 Message-Id: <1327300228-26386-2-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327300228-26386-1-git-send-email-vapier@gentoo.org> References: <1327300228-26386-1-git-send-email-vapier@gentoo.org> Subject: [U-Boot] [PATCH 1/6] sandbox: add lseek helper X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Follow up patches want to be able to seek fd's. Signed-off-by: Mike Frysinger --- arch/sandbox/cpu/os.c | 5 +++++ include/os.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 093e7dc..6e257ff 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -45,6 +45,11 @@ ssize_t os_write(int fd, const void *buf, size_t count) return write(fd, buf, count); } +off_t os_lseek(int fd, off_t offset, int whence) +{ + return lseek(fd, offset, whence); +} + int os_open(const char *pathname, int flags) { return open(pathname, flags); diff --git a/include/os.h b/include/os.h index c17a8a5..d182f40 100644 --- a/include/os.h +++ b/include/os.h @@ -49,6 +49,16 @@ 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 + * \return new file offset + */ +off_t os_lseek(int fd, off_t offset, int whence); + +/** * Access to the OS open() system call * * \param pathname Pathname of file to open