From patchwork Thu May 23 14:43:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1104200 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=vivier.eu 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 458sjL0BhFz9s4V for ; Fri, 24 May 2019 00:44:54 +1000 (AEST) Received: from localhost ([127.0.0.1]:37997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hToxf-0004Gd-Rm for incoming@patchwork.ozlabs.org; Thu, 23 May 2019 10:44:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTowv-0004DH-0r for qemu-devel@nongnu.org; Thu, 23 May 2019 10:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTowt-0006Cm-Sk for qemu-devel@nongnu.org; Thu, 23 May 2019 10:44:04 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:49787) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTowt-0006BX-Jk for qemu-devel@nongnu.org; Thu, 23 May 2019 10:44:03 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N3suW-1gU7aR2VpQ-00zrVE; Thu, 23 May 2019 16:43:43 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 16:43:30 +0200 Message-Id: <20190523144336.13960-5-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523144336.13960-1-laurent@vivier.eu> References: <20190523144336.13960-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:fosqzI4IKyonWFKlDIrgHOJTQ95xdYWKrVKC8/cU5/xi+q9tDbb u8Yfz02StRE9/5LpiJVzOcVnlmEfUIlwgW5XP2UdxxCnCWQkalT9o1rwWm23TygbGc2xuC9 u//TDzzwsp2nLioxm7Mew9Bugtmy9uAThw5ARlPo4Xfy/Q+Sjcj0m06zA+2ACvyI6MW6KED PHHZcDwHjL8Ut8O5Px0tQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:n/TbAKfjseM=:ifwigjrhCyYJrEMH3pvAYf +dXJ2c/8WPWZjM6LjxMOscOyxkcFL2ev5Wd10EJAdx1deIEHRgpNn8n79fPHZ/6mZoPGg8wLh OupJyLskfwTcoXTH+lSgsQrrGmEWzTMwQIFMBZa6vyGWE1hvu2NVWRr2tIofV8qXyjBtLdH8Z RvqguVi1xmPShYC/I6xVsNo8Y89NSacU8UiMfbx2SPWQCMfcnWz/jZNo7FKQ5K3dbdvoDjNXc wv5OQoL1je6M5EJLqeKM2Mp2F0ts+3fTodJb/7DpgJZji9RJxR3kraenOpjNv2Ooiw3icQLas xyAKNkQgajsJ2ZBvkmOuxRxr3hhDsLDHK74rtOnUejazD4nLVgN4/tWKU6QeTttusKbYJ040+ K/3EI9C7Dh4TnvUl9VRzn4V06VawB8bjNVZ0GqfywV2SeAj0k9e9aqkwgemNpsh2syZtAqGqC RULGgqOyPa/GyjesEHRkcTNPw6FrVswrSoHPmZi9RnC521/Bi+NpZOQYxHsXTIlbImaTWmxbF fCh+TQMbfKEB0OVKCs6atLm95aQXI1yDF/JRFXeubQ5dbsmg8vWzokR9lSB5ftlud5AXD5WT3 NpKjTeWUpzvXyNm9QpG4M8cSx4Qhn1MS5UqU/b9LECx3MFJWkC94h6tT6td8krxidak7xXlqZ HgmW/u3xUtsbqTo/li8MnYvYdyGWgSTx/0IybvvT7xdBmukcWmMFEBrt39WGHsW61mC1RuhFh JNxRW226uOcqynpo2HujTCHA1DClnmMhkQz9bg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets 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: Aleksandar Rikalo , Riku Voipio , Laurent Vivier , Max Filippov , Aleksandar Markovic , Aurelien Jarno 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 xtensa. Signed-off-by: Aleksandar Markovic Reviewed-by: Max Filippov Reviewed-by: Laurent Vivier Message-Id: <1558282527-22183-3-git-send-email-aleksandar.markovic@rt-rk.com> Signed-off-by: Laurent Vivier --- 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 37501f575cdd..99ed9d982568 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 5b530e04b8fd..9470a5ce965b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -740,11 +740,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) */