aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-01 21:46:41 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-01 21:46:41 +0000
commit04bb9acec6095bc4198eda84a7f86a6a248e5486 (patch)
treebd9c5a317c0d079961fff005f78ffad04fb93aeb /linux-user
parent408321b61f290b91aca74dce6ab71b8fea2a5469 (diff)
Add mincore syscall
Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5387 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 07992752a2..88513f6c5d 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: