From patchwork Wed Apr 24 12:57:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 1090140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44q0sZ4gybz9s71 for ; Wed, 24 Apr 2019 23:05:05 +1000 (AEST) Received: from localhost ([127.0.0.1]:41410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJHaB-0006b8-22 for incoming@patchwork.ozlabs.org; Wed, 24 Apr 2019 09:05:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJHUq-0002ax-Ap for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJHUO-0000bu-Tn for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:27 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:54744 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJHUO-0007bE-NH for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id E25521A2475; Wed, 24 Apr 2019 14:58:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 9C0481A23E6; Wed, 24 Apr 2019 14:58:02 +0200 (CEST) From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Wed, 24 Apr 2019 14:57:00 +0200 Message-Id: <1556110623-655-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556110623-655-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556110623-655-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v2 2/5] linux-user: Add support for the SIOCSPGRP ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic Add support for setting the process (or process group) to receive SIGIO or SIGURG signals when I/O becomes possible or urgent data is available, using SIOCSPGRP ioctl. The ioctl numeric values for SIOCSPGRP are platform-dependent and are determined by following files in Linux kernel source tree: arch/ia64/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 arch/mips/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_t) arch/parisc/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 arch/sh/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_t) arch/xtensa/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_t) arch/alpha/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_t) arch/sparc/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 include/uapi/asm-generic/sockios.h:#define SIOCSPGRP 0x8902 Hence the different definition for alpha, mips, sh4, and extensa. Signed-off-by: Aleksandar Markovic Reviewed-by: Max Filippov --- linux-user/ioctls.h | 1 + linux-user/syscall_defs.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index ae89516..c37adc5 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -218,6 +218,7 @@ IOCTL(SIOCSRARP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_arpreq))) IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq))) IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq))) + IOCTL(SIOCSPGRP, IOC_W, MK_PTR(TYPE_INT)) /* pid_t */ IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */ IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval))) IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 1e86fb9..2941231 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -739,11 +739,14 @@ struct target_pollfd { #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) || \ defined(TARGET_XTENSA) #define TARGET_SIOCATMARK TARGET_IOR('s', 7, int) +#define TARGET_SIOCSPGRP TARGET_IOW('s', 8, pid_t) #define TARGET_SIOCGPGRP TARGET_IOR('s', 9, pid_t) #else #define TARGET_SIOCATMARK 0x8905 +#define TARGET_SIOCSPGRP 0x8902 #define TARGET_SIOCGPGRP 0x8904 #endif + #define TARGET_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define TARGET_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */