Commit 04bb9acec6095bc4198eda84a7f86a6a248e5486

Authored by aurel32
1 parent 408321b6

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
Showing 1 changed file with 13 additions and 1 deletions
linux-user/syscall.c
... ... @@ -5576,7 +5576,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
5576 5576 goto unimplemented;
5577 5577 #ifdef TARGET_NR_mincore
5578 5578 case TARGET_NR_mincore:
5579   - goto unimplemented;
  5579 + {
  5580 + void *a;
  5581 + ret = -TARGET_EFAULT;
  5582 + if (!(a = lock_user(VERIFY_READ, arg1,arg2, 0)))
  5583 + goto efault;
  5584 + if (!(p = lock_user_string(arg3)))
  5585 + goto mincore_fail;
  5586 + ret = get_errno(mincore(a, arg2, p));
  5587 + unlock_user(p, arg3, ret);
  5588 + mincore_fail:
  5589 + unlock_user(a, arg1, 0);
  5590 + }
  5591 + break;
5580 5592 #endif
5581 5593 #ifdef TARGET_NR_arm_fadvise64_64
5582 5594 case TARGET_NR_arm_fadvise64_64:
... ...