From patchwork Thu Aug 13 20:06:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 72835B7080 for ; Fri, 14 Aug 2009 06:20:20 +1000 (EST) Received: from localhost ([127.0.0.1]:49177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbgmX-0003C5-GS for incoming@patchwork.ozlabs.org; Thu, 13 Aug 2009 16:20:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbgZJ-00040y-1I for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbgZF-0003uJ-Hb for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:34 -0400 Received: from [199.232.76.173] (port=50656 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbgZF-0003to-3y for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:33 -0400 Received: from [84.20.150.76] (port=34716 helo=naru.obs2.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbgZE-0000qT-0B for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:32 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id A649D327406F; Thu, 13 Aug 2009 23:06:26 +0300 (EEST) Received: by kos.to (Postfix, from userid 573) id F396DEE8318; Thu, 13 Aug 2009 23:06:25 +0300 (EEST) From: riku.voipio@iki.fi To: qemu-devel@nongnu.org Date: Thu, 13 Aug 2009 23:06:22 +0300 Message-Id: <547aa1374924001ec97dd08eec89fc59e095595b.1250193232.git.riku.voipio@iki.fi> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 09/11] linux-user: fadvise64 implementation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Ulrich Hecht good enough to pass all LTP fadvise64 tests Signed-off-by: Ulrich Hecht Signed-off-by: Riku Voipio --- linux-user/syscall.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 58c1b29..f90be71 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6649,12 +6649,23 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, arg4 = temp; } #endif -#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64) +#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64) || defined(TARGET_NR_fadvise64) #ifdef TARGET_NR_fadvise64_64 case TARGET_NR_fadvise64_64: #endif - /* This is a hint, so ignoring and returning success is ok. */ - ret = get_errno(0); +#ifdef TARGET_NR_fadvise64 + case TARGET_NR_fadvise64: +#endif +#ifdef TARGET_S390X + switch (arg4) { + case 4: arg4 = POSIX_FADV_NOREUSE + 1; break; /* make sure it's an invalid value */ + case 5: arg4 = POSIX_FADV_NOREUSE + 2; break; /* ditto */ + case 6: arg4 = POSIX_FADV_DONTNEED; break; + case 7: arg4 = POSIX_FADV_NOREUSE; break; + default: break; + } +#endif + ret = -posix_fadvise(arg1, arg2, arg3, arg4); break; #endif #ifdef TARGET_NR_madvise