From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDMA-00047A-5r for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGDM5-0005mi-Hp for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:30 -0500 Received: from afflict.kos.to ([92.243.29.197]:35448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDM5-0005mM-Cf for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:25 -0500 From: riku.voipio@linaro.org Date: Tue, 27 Jan 2015 23:07:18 +0200 Message-Id: <95018018caeea209f58695645fd1d50a9d0ba6df.1422392096.git.riku.voipio@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PULL 07/11] linux-user: translate resource also for prlimit64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Felix Janda From: Felix Janda The resource argument is translated from host to target for [gs]etprlimit but not for prlimit64. Fix this. Signed-off-by: Felix Janda Signed-off-by: Riku Voipio --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index aaac6a2..5658b66 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9529,6 +9529,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, /* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */ struct target_rlimit64 *target_rnew, *target_rold; struct host_rlimit64 rnew, rold, *rnewp = 0; + int resource = target_to_host_resource(arg2); if (arg3) { if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) { goto efault; @@ -9539,7 +9540,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, rnewp = &rnew; } - ret = get_errno(sys_prlimit64(arg1, arg2, rnewp, arg4 ? &rold : 0)); + ret = get_errno(sys_prlimit64(arg1, resource, rnewp, arg4 ? &rold : 0)); if (!is_error(ret) && arg4) { if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) { goto efault; -- 2.1.4