diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2012-02-03 14:48:03 +0000 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2012-04-06 18:49:58 +0300 |
commit | db9526b10a956fd80c08727685c300b63d5a7465 (patch) | |
tree | ad5c49d4ec5972b25eb64b12316f678ecaff4f11 | |
parent | 1e6722f8b0c1eaff305c39d32c07054450ebdad1 (diff) | |
download | qemu-db9526b10a956fd80c08727685c300b63d5a7465.zip qemu-db9526b10a956fd80c08727685c300b63d5a7465.tar.gz qemu-db9526b10a956fd80c08727685c300b63d5a7465.tar.bz2 |
linux-user: Add support for prctl PR_GET_NAME and PR_SET_NAME
Add support for the prctl options PR_GET_NAME and PR_SET_NAME,
which take or return a name in a 16 byte buffer pointed to by arg2.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r-- | linux-user/syscall.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ea44f99..8a92162 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7253,6 +7253,30 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } break; } +#ifdef PR_GET_NAME + case PR_GET_NAME: + { + void *name = lock_user(VERIFY_WRITE, arg2, 16, 1); + if (!name) { + goto efault; + } + ret = get_errno(prctl(arg1, (unsigned long)name, + arg3, arg4, arg5)); + unlock_user(name, arg2, 16); + break; + } + case PR_SET_NAME: + { + void *name = lock_user(VERIFY_READ, arg2, 16, 1); + if (!name) { + goto efault; + } + ret = get_errno(prctl(arg1, (unsigned long)name, + arg3, arg4, arg5)); + unlock_user(name, arg2, 0); + break; + } +#endif default: /* Most prctl options have no pointer arguments */ ret = get_errno(prctl(arg1, arg2, arg3, arg4, arg5)); |