diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-11 14:26:47 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-11 14:26:47 +0000 |
commit | 579a97f7ff4c0f958a5d8adcba717a205bb58567 (patch) | |
tree | 845f187afdd4a15f4625d2156f0fd967beb50c5d /linux-user/linuxload.c | |
parent | 44f8625d23f9807c0853556ffe1c44540bd453f9 (diff) |
Linux user memory access API change (initial patch by Thayne Harbaugh)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3583 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/linuxload.c')
-rw-r--r-- | linux-user/linuxload.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index 42a02d206d..684ec06ce3 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -13,14 +13,17 @@ #define NGROUPS 32 /* ??? This should really be somewhere else. */ -void memcpy_to_target(abi_ulong dest, const void *src, - unsigned long len) +abi_long memcpy_to_target(abi_ulong dest, const void *src, + unsigned long len) { void *host_ptr; - host_ptr = lock_user(dest, len, 0); + host_ptr = lock_user(VERIFY_WRITE, dest, len, 0); + if (!host_ptr) + return -TARGET_EFAULT; memcpy(host_ptr, src, len); unlock_user(host_ptr, dest, 1); + return 0; } static int in_group_p(gid_t g) |