From nobody Fri Oct 24 09:33:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gentoo.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15188330507266.549404299307071; Fri, 16 Feb 2018 18:04:10 -0800 (PST) Received: from localhost ([::1]:56368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emrrC-00067E-Ma for importer@patchew.org; Fri, 16 Feb 2018 21:04:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emrpi-0005Dx-Nq for qemu-devel@nongnu.org; Fri, 16 Feb 2018 21:02:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emrpi-0003UO-2t for qemu-devel@nongnu.org; Fri, 16 Feb 2018 21:02:34 -0500 Received: from mail.gentoo.org ([2001:470:ea4a:1:5054:ff:fec7:86e4]:41779 helo=smtp.gentoo.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emrph-0003Tw-SY for qemu-devel@nongnu.org; Fri, 16 Feb 2018 21:02:34 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 83CE8335C2E; Sat, 17 Feb 2018 02:02:32 +0000 (UTC) From: Mike Frysinger To: qemu-devel@nongnu.org, Riku Voipio , Laurent Vivier Date: Fri, 16 Feb 2018 21:02:30 -0500 Message-Id: <20180217020230.1759-1-vapier@gentoo.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180217020122.1469-1-vapier@gentoo.org> References: <20180217020122.1469-1-vapier@gentoo.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:ea4a:1:5054:ff:fec7:86e4 Subject: [Qemu-devel] [PATCH v2] linux-user: make getcpu optional 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: samuel.thibault@ens-lyon.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not all arches implement this, and the kernel doesn't require them to. Add ifdef logic to disable it when not available. Signed-off-by: Mike Frysinger --- linux-user/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 799c8e2800ea..a9904fac791f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -290,8 +290,10 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsi= gned int, len, #define __NR_sys_sched_setaffinity __NR_sched_setaffinity _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len, unsigned long *, user_mask_ptr); +#ifdef TARGET_NR_getcpu #define __NR_sys_getcpu __NR_getcpu _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcac= he); +#endif _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd, void *, arg); _syscall2(int, capget, struct __user_cap_header_struct *, header, @@ -10595,6 +10597,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, ret =3D get_errno(sys_sched_setaffinity(arg1, mask_size, mask)= ); } break; +#ifdef TARGET_NR_getcpu case TARGET_NR_getcpu: { unsigned cpu, node; @@ -10612,6 +10615,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, } } break; +#endif case TARGET_NR_sched_setparam: { struct sched_param *target_schp; --=20 2.16.1