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
This commit is contained in:
bellard 2007-11-11 14:26:47 +00:00
parent 44f8625d23
commit 579a97f7ff
14 changed files with 973 additions and 624 deletions

View file

@ -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)