From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kl2An-0000rD-0f for qemu-devel@nongnu.org; Wed, 01 Oct 2008 09:55:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kl2Al-0000pk-D7 for qemu-devel@nongnu.org; Wed, 01 Oct 2008 09:55:24 -0400 Received: from [199.232.76.173] (port=54454 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kl2Al-0000pb-4W for qemu-devel@nongnu.org; Wed, 01 Oct 2008 09:55:23 -0400 Received: from ey-out-1920.google.com ([74.125.78.150]:65096) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kl2Ak-0002tA-K2 for qemu-devel@nongnu.org; Wed, 01 Oct 2008 09:55:22 -0400 Received: by ey-out-1920.google.com with SMTP id 4so165807eyk.4 for ; Wed, 01 Oct 2008 06:55:21 -0700 (PDT) From: "Kirill A. Shutemov" Date: Wed, 1 Oct 2008 16:56:13 +0300 Message-Id: <1222869382-586-2-git-send-email-kirill@shutemov.name> In-Reply-To: <1222869382-586-1-git-send-email-kirill@shutemov.name> References: <1222869382-586-1-git-send-email-kirill@shutemov.name> Subject: [Qemu-devel] [PATCH] Add mincore syscall Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" , Riku Voipio From: Riku Voipio Signed-off-by: Riku Voipio Signed-off-by: Kirill A. Shutemov --- linux-user/syscall.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4695416..10af2e5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5576,7 +5576,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, goto unimplemented; #ifdef TARGET_NR_mincore case TARGET_NR_mincore: - goto unimplemented; + { + void *a; + ret = -TARGET_EFAULT; + if (!(a = lock_user(VERIFY_READ, arg1,arg2, 0))) + goto efault; + if (!(p = lock_user_string(arg3))) + goto mincore_fail; + ret = get_errno(mincore(a, arg2, p)); + unlock_user(p, arg3, ret); + mincore_fail: + unlock_user(a, arg1, 0); + } + break; #endif #ifdef TARGET_NR_arm_fadvise64_64 case TARGET_NR_arm_fadvise64_64: -- 1.5.6.5.GIT