From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyeyq-0000lz-Gs for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wyeyk-0005M7-R6 for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:36 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:59199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyeyk-0005Lz-Kx for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:30 -0400 Received: by mail-wi0-f181.google.com with SMTP id n3so2664345wiv.8 for ; Sun, 22 Jun 2014 03:26:29 -0700 (PDT) Sender: Paul Burton From: Paul Burton Date: Sun, 22 Jun 2014 11:25:43 +0100 Message-Id: <1403432748-4679-12-git-send-email-paul@archlinuxmips.org> In-Reply-To: <1403432748-4679-1-git-send-email-paul@archlinuxmips.org> References: <1403432748-4679-1-git-send-email-paul@archlinuxmips.org> Subject: [Qemu-devel] [PATCH v3 11/16] linux-user: support ioprio_{get, set} syscalls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , Paul Burton Add support for the ioprio_get & ioprio_set syscalls, allowing their use by target programs. Signed-off-by: Paul Burton --- Changes in v3: - None. Changes in v2: - Declare the host syscalls conditionally upon whether both host & target define their numbers, to avoid compile time warnings/errors about the host syscall functions being unused when built for targets which don't support them. --- linux-user/syscall.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0d8cd0b..f90dd99 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -252,6 +252,12 @@ _syscall2(int, capget, struct __user_cap_header_struct *, header, struct __user_cap_data_struct *, data); _syscall2(int, capset, struct __user_cap_header_struct *, header, struct __user_cap_data_struct *, data); +#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) +_syscall2(int, ioprio_get, int, which, int, who) +#endif +#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set) +_syscall3(int, ioprio_set, int, which, int, who, int, ioprio) +#endif static bitmask_transtbl fcntl_flags_tbl[] = { { TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, }, @@ -9488,6 +9494,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; #endif +#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) + case TARGET_NR_ioprio_get: + ret = get_errno(ioprio_get(arg1, arg2)); + break; +#endif + +#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set) + case TARGET_NR_ioprio_set: + ret = get_errno(ioprio_set(arg1, arg2, arg3)); + break; +#endif + default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); -- 2.0.0