From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyeyw-0000xX-IL for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wyeyq-0005OC-LT for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:42 -0400 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:40157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyeyq-0005O1-FW for qemu-devel@nongnu.org; Sun, 22 Jun 2014 06:26:36 -0400 Received: by mail-we0-f170.google.com with SMTP id w61so5609957wes.29 for ; Sun, 22 Jun 2014 03:26:35 -0700 (PDT) Sender: Paul Burton From: Paul Burton Date: Sun, 22 Jun 2014 11:25:47 +0100 Message-Id: <1403432748-4679-16-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 15/16] linux-user: support the KDSIGACCEPT ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , Paul Burton Add a definition of the KDSIGACCEPT ioctl & allow its use by target programs. Signed-off-by: Paul Burton --- Changes in v3: - Translate signal number to host value. Changes in v2: - None. --- linux-user/ioctls.h | 1 + linux-user/syscall.c | 7 +++++++ linux-user/syscall_defs.h | 1 + 3 files changed, 9 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 309fb21..f278d3e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -64,6 +64,7 @@ IOCTL(KDSKBLED, 0, TYPE_INT) IOCTL(KDGETLED, 0, TYPE_INT) IOCTL(KDSETLED, 0, TYPE_INT) + IOCTL_SPECIAL(KDSIGACCEPT, 0, do_ioctl_kdsigaccept, TYPE_INT) IOCTL(BLKROSET, IOC_W, MK_PTR(TYPE_INT)) IOCTL(BLKROGET, IOC_R, MK_PTR(TYPE_INT)) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 876e557..7765658 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3696,6 +3696,13 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp, return ret; } +static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp, + int fd, abi_long cmd, abi_long arg) +{ + int sig = target_to_host_signal(arg); + return get_errno(ioctl(fd, ie->host_cmd, sig)); +} + static IOCTLEntry ioctl_entries[] = { #define IOCTL(cmd, access, ...) \ { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } }, diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a1f1fce..4adfd3a 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -831,6 +831,7 @@ struct target_pollfd { #define TARGET_KDSKBLED 0x4B65 /* set led flags (not lights) */ #define TARGET_KDGETLED 0x4B31 /* return current led state */ #define TARGET_KDSETLED 0x4B32 /* set led state [lights, not flags] */ +#define TARGET_KDSIGACCEPT 0x4B4E #define TARGET_SIOCATMARK 0x8905 -- 2.0.0