From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788610; cv=none; d=zohomail.com; s=zohoarc; b=oJvsvBnFzCDyaSo5M7wLUVpo/khWAA8jZedWMzSAYimIJjZfHoXGN/yyYxbjpcjAQRPG/w2E54jTAq+d3RFG2hjuanJLjn525kk92O2q7avD2sQD6FaHkVJbQ9qi9mQRkVKsglAZT6LF5VU6HPrGeP1BYhxU/pYZjkt4FRooyuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788610; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UzGMzmXLzESuVhYFo6WrRdQJb8qigTb6CLPMTcgkfaA=; b=fdZC3tjIrOn8Y1HjzdOTTVZLmtGLcGU97K+r5fpVvGwvlXmdkhEjI3HZWD1dJvBuiXXVHez73KnG0j1JJSJMbbaGyQJCWdUuRX/72np3lCITPYAQapyPogervKu8WPSy+NZ0l8Uk8vqR2eQEBDIXv2qKHoXh9W4crZoNGfOkTK8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788610768597.9221900640965; Fri, 3 Jul 2020 08:03:30 -0700 (PDT) Received: from localhost ([::1]:44532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNDt-00041H-IG for importer@patchew.org; Fri, 03 Jul 2020 11:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN6z-0003dE-8r for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:21 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN6x-0006iO-GY for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:20 -0400 Received: by mail-wr1-x443.google.com with SMTP id z13so33013171wrw.5 for ; Fri, 03 Jul 2020 07:56:19 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UzGMzmXLzESuVhYFo6WrRdQJb8qigTb6CLPMTcgkfaA=; b=qmKRnkdVmlWnuU6c8WWAPJvhD014ix7ust4uOPrgIpO4zqB/zfN1oCwdBt44MI+CwK bRr+vnDEri/khiWgqk/ornC409xPdmPFyL44hwisBjNLRWhJ56Hb7BlltcTR91cj9Qwb dwpS6N1A9dfnfIMa+j3OBbBlCJnDf8tmQf+2HOvcjeZ1mbslcIGtkeCLSodW+f3SHoZD DIFa3Ylz8beHIdvv2OcKFNZr4/mSY+7vYMRyJoyA9xpQbUulTN4I6jZtWlXhbxDMsNql iyLK25h9iobomMCJ5ERFIHE0OhWuc8Y0ggNNtIxiWxtCY9EoGfHGMIeRkdGtA+XpEaTa Q7+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UzGMzmXLzESuVhYFo6WrRdQJb8qigTb6CLPMTcgkfaA=; b=Bk3WIsLARFI9h5X5s9wDIYT8aVSL/aC4ube/7Rzo1wUWOSQxU/TlHpwVmxV2JQmdYz Bk3MRNAdnICtPdIrddtIs+fgE5ClmkIGOWy7MpJq5gwor5vMNlOUuOj1OtKa7mMQz/8V AE0cFd0/VymEs4rjy/skIYk0GgECJGGMPW/7W2Z/cHKdjB03zgiB/0mWv/gOpDRimZU6 IyEUEYaadWIrzhoK9kEqVqhVZ8ZqLnu+vMVo+fbD+CcTsZc4e9zqKXRNI4XHodp5SCWS eNybW82WnO2Bnrj9tfaWbGF6rhu0kGwGaSxs7MxjvdH0D2qR3tM9Nn0HhgNDp+5LeiXx qJrg== X-Gm-Message-State: AOAM530US/gC0mZ5ad15f04dn8fAcYvKtzGPVzXYudLC9fLoJs3ad8Lw YTrZafI3bX2ay/2uvWk/uv1rj5uZPB4tUw== X-Google-Smtp-Source: ABdhPJxeRGkcYjp/QSq/m+Bns2NV/3x/kPBOMrgWjmGkIiXFqNQjz80kHU3gIpSCOL6H/xvQTFSQXw== X-Received: by 2002:adf:f984:: with SMTP id f4mr36843138wrr.221.1593788177757; Fri, 03 Jul 2020 07:56:17 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 1/9] build: Enable BSD symbols for Haiku Date: Fri, 3 Jul 2020 15:56:06 +0100 Message-Id: <20200703145614.16684-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Tell Haiku to provide various BSD functions by setting BSD_SOURCE and linking libbsd. Signed-off-by: David Carlier [PMM: expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8a65240d4a8..c9c135b70bc 100755 --- a/configure +++ b/configure @@ -903,8 +903,8 @@ SunOS) ;; Haiku) haiku=3D"yes" - QEMU_CFLAGS=3D"-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" - LIBS=3D"-lposix_error_mapper -lnetwork $LIBS" + QEMU_CFLAGS=3D"-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS" + LIBS=3D"-lposix_error_mapper -lnetwork -lbsd $LIBS" ;; Linux) audio_drv_list=3D"try-pa oss" --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788456; cv=none; d=zohomail.com; s=zohoarc; b=h2zxLsBRuOk+S6z3+IoCHRTLq/D8viTqgw/JkffntkZe/XAxJ52u5HfHt5RDoMsGUqUJpAISRTgRco/kxviZCBTtcUIlQRkCMiLRpOS6t05JMeWhBre2ulNxg5Jl0/PfQmcwhqwtxvvdpysEmgt1Mtd4S5nnaHOVFqZ7+iz+AO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788456; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pTkmSlbOfuTPhMuEdajkOu0uB2oGQShiEgcGQkMuHKs=; b=HaK5/4HhJXCvYlcwwHsx/9sI3S8ZRwtH6IR+WxHtMr4cbKlItUDxJDPwAuSWnwKEcO9EpVFYJa6kuO2mplDp5msoKI3eq7+6sxhNb8KCJm5v/o5y4V+QlmDJpR9Zu4vQ5YJULPWeFoF5Hq7JYOVUutrjKOSZjTr6Fe395sSCq78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788456269679.8505910227357; Fri, 3 Jul 2020 08:00:56 -0700 (PDT) Received: from localhost ([::1]:38116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNBN-0000dm-Ow for importer@patchew.org; Fri, 03 Jul 2020 11:00:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN70-0003fp-G6 for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:22 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:35680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN6y-0006ib-Lq for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:22 -0400 Received: by mail-wr1-x441.google.com with SMTP id z2so10754799wrp.2 for ; Fri, 03 Jul 2020 07:56:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pTkmSlbOfuTPhMuEdajkOu0uB2oGQShiEgcGQkMuHKs=; b=LZ7AoHVCsQPNasBYn0ShGPO+4UEJmYlV4arLMrZec3Z0AI3FTt9Ole8f3B4SFSUUsj j2kbzq0GHVhduevJCm2Z9Khgpo4A09/1l7kCONDZ5z/HmPk0GootXEc8Yv1ceCXJZ28G xsCx38LxMX4tlUSccQYW9sLEysmCSBdDUdEEBro1Idnk+SFt1h5eee8UugFscKZtqQ2Y Uw6X6+JiPDErvTVC2Cx2uBccIylaeFC626gOt46oR0zFuonqDFNeIdh8Jyc2694lYFN8 XKco9Qrt4TjVvUWnWWv9DIqnO/T8ndWFQxtP7EKVf3iXSFl8d1gCH9SWqXUwUGMzwZMR mZXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pTkmSlbOfuTPhMuEdajkOu0uB2oGQShiEgcGQkMuHKs=; b=La/pTn77CnDv2RcvT2kPOCCPINbjOueRAArnUTHJ0FoWV7oDpzFJJrJrpo3xHh8g5C CzO0U2N9VPfWlyMvXF8/8Xqf3Kw99d037rTJB8ndjNzDzlstHGpkVQs6+3d2L8PLQ1S5 B9veuIkYg64rpm+VLn05XDDcxFLhHUD4cQva7agAYV30MH6Xq6/ZvByBFfj2iC48iry2 f2j+XPrtANrSdN/AnKvqyh9n7e1drVt8KKCUB4LZ0CiQhdWabaFSaPF8Wtx5yTYib2jC z6IYrMYctQ+PJ43+7f/BA29jyVHEBxh3P0ZU+QgORn28hD1NfCNiR3Cds3HpjpBOJKjU 1NLw== X-Gm-Message-State: AOAM532LAB3jsrZapavxu2Cz1iLWimRR1rRgiP8KqdEaCu2tP9XFcghG 2rBH+KkoMWj/5tiWpAc93nVHE6ENF6o4ig== X-Google-Smtp-Source: ABdhPJw9v6DPoqmTOa2hgPCg9FgRZjD7Gow8VNxlGk3A+LWEX+uihYxafpsoCaTKsr3k2RrU2rSj+g== X-Received: by 2002:a5d:664a:: with SMTP id f10mr37110886wrw.300.1593788178940; Fri, 03 Jul 2020 07:56:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 2/9] util/qemu-openpty.c: Don't assume pty.h is glibc-only Date: Fri, 3 Jul 2020 15:56:07 +0100 Message-Id: <20200703145614.16684-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Instead of using an OS-specific ifdef test to select the "openpty() is in pty.h" codepath, make configure check for the existence of the header and use the new CONFIG_PTY instead. This is necessary to build on Haiku, which also provides openpty() via pty.h. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- configure | 9 +++++++++ util/qemu-openpty.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c9c135b70bc..5455ae10d05 100755 --- a/configure +++ b/configure @@ -2386,6 +2386,12 @@ else l2tpv3=3Dno fi =20 +if check_include "pty.h" ; then + pty_h=3Dyes +else + pty_h=3Dno +fi + ######################################### # vhost interdependencies and host support =20 @@ -7856,6 +7862,9 @@ fi if test "$sheepdog" =3D "yes" ; then echo "CONFIG_SHEEPDOG=3Dy" >> $config_host_mak fi +if test "$pty_h" =3D "yes" ; then + echo "CONFIG_PTY=3Dy" >> $config_host_mak +fi if test "$fuzzing" =3D "yes" ; then if test "$have_fuzzer" =3D "yes"; then FUZZ_LDFLAGS=3D" -fsanitize=3Daddress,fuzzer" diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c index 2e8b43bdf57..9d8ad6905e0 100644 --- a/util/qemu-openpty.c +++ b/util/qemu-openpty.c @@ -35,7 +35,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" =20 -#if defined(__GLIBC__) +#if defined CONFIG_PTY # include #elif defined CONFIG_BSD # include --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788347; cv=none; d=zohomail.com; s=zohoarc; b=Mne1O079jQcqHEwKXIlkyN3z8HQKBSEu6GwiDzKgk5Ew4lMA3/NOueQ3ZP3Ag9Bx3OTXUh1wT3Lur9r1Schz3jaRhjhcVwfM849cG4gPl3EJHFl8blPAy8Ybt16BPPs7Ayyjgw8qR0IItGynRyoAyazpa06yuBX+k1ad/eohxeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788347; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xdwJ7T2gYvtwSqRJeSeL30u3SzAKMgTYxu/rW3+6M/8=; b=ON4xEiyyPTW4trH3fbSEGe17mJpNXjmUzRM/oz/O9kttCj1W0Bq88zNhs0GR7X814yCGwh3wTXUChAtoxMqGJ4vkqpJ5YJdWOdCeXG5J2oumPYCF2+K/WISazqf0sTg2tahLSCJcnOWYu5zvk9fkxKM8dG1u+1gCCIqhdU4Cm9c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788347533850.5350291239483; Fri, 3 Jul 2020 07:59:07 -0700 (PDT) Received: from localhost ([::1]:33288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrN9e-00070Q-34 for importer@patchew.org; Fri, 03 Jul 2020 10:59:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN71-0003ib-Kw for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:23 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:35036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN6z-0006jL-R4 for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:23 -0400 Received: by mail-wm1-x343.google.com with SMTP id l2so32874530wmf.0 for ; Fri, 03 Jul 2020 07:56:21 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xdwJ7T2gYvtwSqRJeSeL30u3SzAKMgTYxu/rW3+6M/8=; b=MCh4Ug0JmCPpVEY2DbybO3y27usxhdBrluHJPNBGMh5M/x1P3dHWT6tTEvz8aX7381 EkxVZsP1qsMNT4qM+/v5hzefmlpiTy/o68XLNqpj1jDIR/QeBV8QjbPH/d4ZIUIGkiZI NTek2pEvPEv90oB8YW/62DJJmTJ5GpO0C3WY4QUqB5r4Crgt+n3cpQ+DtpoOvfRWFIL5 bf2l7vRQezIG16v3cTnEocJCGSgZeh18hO7lXDGuAUJDGaiBEf2YOXsaiv+DcXr8Y8MV yfHGOiC7HyQuw9bNxbIo9Lw4FfyG8mdk4FteU/Feml8hGzbthZJfAg4KEslcI1zAhItn UTAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xdwJ7T2gYvtwSqRJeSeL30u3SzAKMgTYxu/rW3+6M/8=; b=X9JJpTHyJVGStWOq0CwIwfqB6VnY57LYvCtO2w+3SclFXQnTgVhcL2QeHVPv+2Te0C mkDfMX2P+/wzUVXoG9I9NqOZSmy31wDmVtyusO4kLnh25UlCHdK+3MFd+pYm48v00Qoq 0NASZMukcCJkAlD6USSmkA3k9E8mrX3gqugQuhwk+P7yltge8bvbfJ4pJjj56o/VrTlT Gi9zPmtjRxtSjQAPT4T0F2ODAlP74EauZMo5knIsGqpakOnyFG+IfJ163S9kE82BSW4W 5R3QVLEPJ0VO5jLskgLl/gepf5ryIJTKrxRD4wbCF+OhdL/OBEO6gBmvTmggD40oy1zt kh3A== X-Gm-Message-State: AOAM530DyQr5t9Ex5ce+QZFFLGFiXYUqa44TfW3kYTwL7cNUKweZcfFz ec0UKeq2/oGI9rI60CVtoKSjymD0myTKug== X-Google-Smtp-Source: ABdhPJyAqaT/mkiD7SpYhyktS+Mo+xjvEKf28v++P/kmqNHYw1PzNPLLX2C1J+AOz3ykrIPvbGLXUg== X-Received: by 2002:a1c:2349:: with SMTP id j70mr36294944wmj.22.1593788180161; Fri, 03 Jul 2020 07:56:20 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 3/9] build: Check that mlockall() exists Date: Fri, 3 Jul 2020 15:56:08 +0100 Message-Id: <20200703145614.16684-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Instead of assuming that all POSIX platforms provide mlockall(), test for it in configure. If the host doesn't provide this platform then os_mlock() will fail -ENOSYS, as it does already on Windows. This is necessary for Haiku, which does not have mlockall(). Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- configure | 15 +++++++++++++++ os-posix.c | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/configure b/configure index 5455ae10d05..ddc53d873ef 100755 --- a/configure +++ b/configure @@ -2392,6 +2392,18 @@ else pty_h=3Dno fi =20 +cat > $TMPC < +int main(int argc, char *argv[]) { + return mlockall(MCL_FUTURE); +} +EOF +if compile_prog "" "" ; then + have_mlockall=3Dyes +else + have_mlockall=3Dno +fi + ######################################### # vhost interdependencies and host support =20 @@ -7865,6 +7877,9 @@ fi if test "$pty_h" =3D "yes" ; then echo "CONFIG_PTY=3Dy" >> $config_host_mak fi +if test "$have_mlockall" =3D "yes" ; then + echo "CONFIG_MLOCKALL=3Dy" >> $config_host_mak +fi if test "$fuzzing" =3D "yes" ; then if test "$have_fuzzer" =3D "yes"; then FUZZ_LDFLAGS=3D" -fsanitize=3Daddress,fuzzer" diff --git a/os-posix.c b/os-posix.c index 3cd52e1e700..e02b566940c 100644 --- a/os-posix.c +++ b/os-posix.c @@ -337,6 +337,7 @@ bool is_daemonized(void) =20 int os_mlock(void) { +#if defined CONFIG_MLOCKALL int ret =3D 0; =20 ret =3D mlockall(MCL_CURRENT | MCL_FUTURE); @@ -345,4 +346,7 @@ int os_mlock(void) } =20 return ret; +#else + return -ENOSYS; +#endif } --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788375; cv=none; d=zohomail.com; s=zohoarc; b=LEL1Pq0owyr70Ru8HZpE+D9PA6hA0CFI13kTZDnU6TMdGgMW8DwPLgjrgVzxthE1Ax/eRrNTwaV7VE3SuG2+0zgT86/pfiVnpTJAWWxiwkhNzjmIDyh+a2RjgH9utggiI8I0pf80tDMIGmLZLzzuVwUMfDrr5ZX/maBppkKWSxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788375; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=srUPSKtqaAn1mMUbd1++IlCCTBASkwRrKLk2aoUltZI=; b=P09DJ5WgEga2WBnAKlc39C+KRKgcA3IwP7P8wZ5IeuUKZ0Amkip4e7Sh+Lu60uUUHRVqlDBVXDGhkaqMSNZc6sX00pf1Ib5eDQi29HH7fntzsE0jrYs9Sp5ocicBtjxKxprNX3bnyzcdrheKWIVHofJLLLqvhwAKIPi9YB+dM0A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788374994216.13889357318465; Fri, 3 Jul 2020 07:59:34 -0700 (PDT) Received: from localhost ([::1]:35080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNA5-0007lt-1p for importer@patchew.org; Fri, 03 Jul 2020 10:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN72-0003lJ-MU for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:24 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:32962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN70-0006ju-ST for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:24 -0400 Received: by mail-wm1-x343.google.com with SMTP id a6so22515539wmm.0 for ; Fri, 03 Jul 2020 07:56:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=srUPSKtqaAn1mMUbd1++IlCCTBASkwRrKLk2aoUltZI=; b=tabBWabvR9rAPGPW+8opjMD8UrSGSzpi+Icu6HW7o6a3r822/UF7H1LuCGGfIp7AD3 1YVwcIamsQUtEjTGlvD6S5kf2XQxBK35wYprcmT+AgmkTKNhE25VojZKRpXEQsMRHDeg 3dnJUvp2VVYsM/Lw14za3qgxaRy/9vCTwHsFqbAT3wLYKeV84PBfeRSf4cKhd/NxoYNa 1FIkGMRTLu38dm2r4IpM9X8PyVrIB+JTEIem4w9pn9RLrS72uautys1xpnseVk5pz7eu 5oqbb+BPkqBDbmf/dtm6yV4JAYZ2bDAWUPhCFu8IO4JPYLSP0F0t79t/4OxeWTDKyOOF F6Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=srUPSKtqaAn1mMUbd1++IlCCTBASkwRrKLk2aoUltZI=; b=hSBeCx78AWBsqONVtqrL3msc77G+D/nV1nTvzz3BOHXARaC9G8mXC7Hp7aps+R7U+n kizk8R9AU+dke5FBXRYyW99O3QLCsfzW49upErgF1p8fjsShYOJA4Xqhr66HXx8r+7/B J4vuKqgrWAs9fOTYgoM8XKbcHe6DjPQyB6rosbIgoTtqWDXgTHbdzKlK2hjXPW482fPA 39wctAWQn5Bk7g9RffyViIniN3O9Mllne/UkihWpIb69BuXylKi9IGmgpyd9kY4kwnT3 F0ELNcvlD6+yBL91zVA7MvL8nCHVmr6YO5jRH2hdUpi7TF+NlF3LUHXUngpU04JlBR4m SLUw== X-Gm-Message-State: AOAM532358tm61SRGs4Qv0Sl9iwIl4WWKsOTuFODQ4rjWqupTHVq2J6U 1RFwfyxG3Y3ROwNER1vG2ITOmy9CINR/Gg== X-Google-Smtp-Source: ABdhPJwGNwumLD3T1Qz741QSvoO4gMrZzOj/5VqiGPnwTYrShI/KeIjbAiHMN4onzicsx2+PpM/Eng== X-Received: by 2002:a1c:4846:: with SMTP id v67mr39261676wma.175.1593788181311; Fri, 03 Jul 2020 07:56:21 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 4/9] osdep.h: Always include if it exists Date: Fri, 3 Jul 2020 15:56:09 +0100 Message-Id: <20200703145614.16684-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Regularize our handling of : currently we include it in osdep.h, but only for OpenBSD, and we include it without an ifdef guard in a couple of C files. This causes problems for Haiku, which doesn't have that header. Instead, check in configure whether sys/signal.h exists, and if it does then always include it from osdep.h. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- configure | 8 ++++++++ include/qemu/osdep.h | 2 +- hw/xen/xen-legacy-backend.c | 1 - util/oslib-posix.c | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index ddc53d873ef..d131f760d8f 100755 --- a/configure +++ b/configure @@ -3212,6 +3212,11 @@ if ! check_include "ifaddrs.h" ; then have_ifaddrs_h=3Dno fi =20 +have_sys_signal_h=3Dno +if check_include "sys/signal.h" ; then + have_sys_signal_h=3Dyes +fi + ########################################## # VTE probe =20 @@ -7398,6 +7403,9 @@ fi if test "$have_broken_size_max" =3D "yes" ; then echo "HAVE_BROKEN_SIZE_MAX=3Dy" >> $config_host_mak fi +if test "$have_sys_signal_h" =3D "yes" ; then + echo "CONFIG_SYS_SIGNAL=3Dy" >> $config_host_mak +fi =20 # Work around a system header bug with some kernel/XFS header # versions where they both try to define 'struct fsxattr': diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 0d26a1b9bd0..6e0cf9132d9 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -104,7 +104,7 @@ extern int daemon(int, int); #include #include =20 -#ifdef __OpenBSD__ +#ifdef CONFIG_SYS_SIGNAL #include #endif =20 diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 7d4b13351e0..965abe3ad34 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include =20 #include "hw/sysbus.h" #include "hw/boards.h" diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 39ddc77c85b..7ad9195c445 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -38,7 +38,6 @@ #include "qemu/sockets.h" #include "qemu/thread.h" #include -#include #include "qemu/cutils.h" =20 #ifdef CONFIG_LINUX --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788610; cv=none; d=zohomail.com; s=zohoarc; b=WKRyeAO/IG+y8rCI2O3rT1Ap9H+4a/UxxVRY/BgxfDs/evA8YjiHPZ/N6zk2Y7hs9oyhwWmCm3nhl7gFAj1uX0hKIEHd5Ov6t20rZDd18Kg+m8DzhJGxTqSssxledIS72iBFfysKB6f0/XB3t4LMObeNacg8D9rxRNojG3k/WOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788610; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UfCAxzD4q2CqsaGVTTzt8XAhtxJV3NEqxhJ1Ol7/4DM=; b=FDid3TPb3sLpPB3oP12ZAcln8peI3UIikxcK/cLXNpkXhAs5PK5jdBXZcnm+rDS5IMb4knwMd5PWEDIeHx/4ptgUrypqKIFvx0MZLjURieHgGUqzY+6jdtigSbrjpG/6lCrY2Oi8KFM8Gd20BT6084uh8jnx4O1VCA7tN8/hIkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788610779298.9062604084796; Fri, 3 Jul 2020 08:03:30 -0700 (PDT) Received: from localhost ([::1]:44458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNDt-0003xn-8I for importer@patchew.org; Fri, 03 Jul 2020 11:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN74-0003oV-3C for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:26 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:41815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN72-0006k3-9l for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:25 -0400 Received: by mail-wr1-x444.google.com with SMTP id z15so21730862wrl.8 for ; Fri, 03 Jul 2020 07:56:23 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UfCAxzD4q2CqsaGVTTzt8XAhtxJV3NEqxhJ1Ol7/4DM=; b=DsdMiwH9LqfryecOQ76PfX133lT+fowNporgpemXS4dZXfQA1FwN8V7uCAxRCf4K+d 8RYDgL9K3EkyzqEy5izdfW0O82RES96F68kxI/YE2bLhZWPGhDa5D/u1dFTFvJs7COql kqbHgVFOI0qELVhR9+yGzW5zlvuLlG8oYbt1R1PPhKX5mFw3TS4P96MvZwXVQ61reg9p J65dtd8JwlxJFS8T5YCZ1QC40EOQXHz+fbX4FDWPO6HBKhNZsypULLZ7e2/nA0fuwcSM EPyFZMorUdRuni3jUCL5dGThxQ3/9V4WRZ++BaMf5b0r2xnPN39iKdQVeXvdp5WP1+EY BkNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UfCAxzD4q2CqsaGVTTzt8XAhtxJV3NEqxhJ1Ol7/4DM=; b=k2JDSVIifHSh9md8Il5tqU0VnfVVx6B/VgEvixl2/EBlu/eACSaPyaQwpqTt1e5r+6 hqx3BWO2jyk6SAoNslyb/Jww3C6c03q8njCkZn7DYiMBHmw/ycux27kZdOknlTJla2vH aJhog2gvA28d7yr0hhZIS8XvPhkKDvU4FASHMsT5sRElTY15L+LRqeBunBWQkJMRmutk rt8Gg/uO8dukoOtz7tQ5+nvTco0pPl6q2Talc61YomnVbyH0JUqEusFg2tiLQY86vGvu TVzUg4f+P/KeNxkFe2hWnCtgRLqFjcGU8Wpu5W0vo4Nqko0KzFgPayrlR9yYj/H/8jz6 80FQ== X-Gm-Message-State: AOAM532rfOwmIaWXJaTG42Ni2yEplUYD8/UtyQiMwfAomb/iS75ON49B qr1MSb3yBYiJsw4xCuJ7+M8jq77257EqsQ== X-Google-Smtp-Source: ABdhPJyPzOSOd4ewffKfcJiqpEG9f/97U+VyAkBhHIv08YxCiYDW4FGsRWwy+tPd7AMBDj2PLrMqHw== X-Received: by 2002:adf:c542:: with SMTP id s2mr9780901wrf.132.1593788182511; Fri, 03 Jul 2020 07:56:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 5/9] osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL Date: Fri, 3 Jul 2020 15:56:10 +0100 Message-Id: <20200703145614.16684-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Haiku doesn't provide SIGIO; fix this up in osdep.h by defining it as equal to SIGPOLL. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth --- include/qemu/osdep.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 6e0cf9132d9..e090ead8262 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -425,6 +425,10 @@ void qemu_anon_ram_free(void *ptr, size_t size); #define HAVE_CHARDEV_PARPORT 1 #endif =20 +#if defined(__HAIKU__) +#define SIGIO SIGPOLL +#endif + #if defined(CONFIG_LINUX) #ifndef BUS_MCEERR_AR #define BUS_MCEERR_AR 4 --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788559; cv=none; d=zohomail.com; s=zohoarc; b=TUTmatfEzZuXE+oWbdjhyt8HjFXtSK5nrvI7iozq1EjtQZWCmzf41TY+7IqhbEx/oIfJuJuwjs8xjq/uFH58MBHPwYU+/ghXsVVi99zOZIoMMcK7PCa7ktW+BLDlvVb/D0LujNlL9X372US3iMwsO2e0hBb+tUa0EWnAI4iA+c4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788559; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oblRNa3Qf/H2qkj0LJ6Mp9Oq0mTcNDfKBA/ktyk5uVY=; b=BVqrVBdDcnWb323YEgJ9YtU3CbrMDjckih7NtZpSClzBunopa7wWB882y+uE4FpJX25OGQ4LUxbScx7UW8cSQ4FwbKX3MAIIzj9JHA+kkOfFXMfWJXNriECku5uZpQ3XTw33iMwZe2g89aABOtQLFtBPO3EIDYqh6+giosMgJe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788559843645.9047666242611; Fri, 3 Jul 2020 08:02:39 -0700 (PDT) Received: from localhost ([::1]:42140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrND4-0002nC-GQ for importer@patchew.org; Fri, 03 Jul 2020 11:02:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN75-0003ro-Dk for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:27 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN73-0006kK-FP for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:27 -0400 Received: by mail-wm1-x343.google.com with SMTP id l17so32299172wmj.0 for ; Fri, 03 Jul 2020 07:56:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oblRNa3Qf/H2qkj0LJ6Mp9Oq0mTcNDfKBA/ktyk5uVY=; b=SKbhtJdmnqWawTJe5v7ju0w2hlz1gsuo2eAu9Xy+LKN+r1JFtMs+PtwC9GEMFsStyG cMLLJsrllmhEVBtFtkOAaYX2Xl4tGrgVEBC3p0m+PB2KOj7fDr6rA4tB618EpVmcmslS /f8IpfiEq0xS4fePTgo+TlUlv+jUVIURUxuT7Qikp+gluWtZKF/aLxwLqbxJ1g+0ZdqO yQ4l2ekv/WOze12wo0SyZ2fCWKA7bpV9rvrbttqh/qYxw4UYpBOinGPnvcv+BcYV3dLV zwxx06N2iXBp8IUMFH2J7ynoHQwyVg6t1LBd6K95qUp0GV/1fk9JoeLjz/F70Uj8rWHX yMGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oblRNa3Qf/H2qkj0LJ6Mp9Oq0mTcNDfKBA/ktyk5uVY=; b=ExB9/KJxVfoJCWKQUN0mYFDw4WWNVjzaB89flKqoq0v9pzqKlV4ew6xTn0wCm2/w9C 0eRRJXMIXjcdsCsoGqxoPDBTEZBdB0tV/WbUomVBsbPFpEYg1ciOhbKNjhHDdbj/MTR6 Z9bX0L19J7QHpf4i4TyMM0AEgdWtnXVnrPFIeTDKOqK82+gp0FrOBC4rdGIt5dw+lYPA j/Derw5Q9id9Jz0J95PXtkaVh+JjAgNgrt/tJD/FYq0xgWAXWvTLLJomaGDDT9DpAGat rR97QwUrB7muNDpizLLRTp5LiXbLtQdp3aclYjtyWVnEGlWGzUpjsUBX7q+xNO3EC6Xs 47YQ== X-Gm-Message-State: AOAM533CiEMrKfM/BMHevC4C1sQU5e3S+2pUyKu/wi7D2pRM4xdcnL6u C3a7eOZlNwCA9psWqFKXAyeIq4147rXqLQ== X-Google-Smtp-Source: ABdhPJxREzIlQ8NydptpPuKNWRXYsyMAFj4a2nRTTyYNAYlD8Wf6NfjY6tHrsw7V+jKNsBEMRpORFg== X-Received: by 2002:a7b:c090:: with SMTP id r16mr34964783wmh.143.1593788183915; Fri, 03 Jul 2020 07:56:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 6/9] bswap.h: Include on Haiku for bswap operations Date: Fri, 3 Jul 2020 15:56:11 +0100 Message-Id: <20200703145614.16684-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER Haiku puts the bswap* functions in ; pull in that include file on that platform. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/qemu/bswap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 2a9f3fe783e..1d3e4c24e41 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -8,6 +8,8 @@ # include #elif defined(__FreeBSD__) # include +#elif defined(__HAIKU__) +# include #elif defined(CONFIG_BYTESWAP_H) # include =20 --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788700; cv=none; d=zohomail.com; s=zohoarc; b=Aj1A56RWGbPCzbMU0vAyS+UnQfk7IB4gT3/8k/P1L1O1a4YYt6ahdAaXapXEX/ETwtL1mNhfgkgoIVRDQ8GjDppE/HFdQBHLA76LOhCOCFqRrBhjkiB0KrQ6Cl5pPcp4RXdzc62bDzelf0K9sSk5wRmT/c8Xhpholp58fHICdUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788700; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DlVNGvmFOuroNPsVcl6xee1wnTJNkNDxh9QND76iGNw=; b=cm3hIumvn1Esf+Bqr0Mv+0EnNEVcZ9FclXKhukSr0AB7uGvg9LeFo+01JJTPJEsIJWXwozamO5ByKUDf4yYFgKvCB3Hf9tvU+vfGnjQuZJitHbGgnwUv98hzdf0tDweCwr9pxfjFMFjbYpWR0h3/IDF1FqmYVp4Mv5cXG5y0grg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788700435763.3522917552725; Fri, 3 Jul 2020 08:05:00 -0700 (PDT) Received: from localhost ([::1]:50954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNFL-0007LC-11 for importer@patchew.org; Fri, 03 Jul 2020 11:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN76-0003vm-U5 for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:28 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN74-0006lK-ER for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:28 -0400 Received: by mail-wr1-x441.google.com with SMTP id b6so32991399wrs.11 for ; Fri, 03 Jul 2020 07:56:26 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DlVNGvmFOuroNPsVcl6xee1wnTJNkNDxh9QND76iGNw=; b=nQ1V8V586VCT77NAIzlFIqKJPcU9nPvI0+IrXh5vuUkyIDyhlLsy5hYB4Z5kV5Mdyv T/CBVvzrjV3u76hLbPwXes3EijMIn20IWoA8uxteP2Ljy1xUZ2zRzqGjTHMFo+m6hwmw z9J6VEfafVBj3G4X9yiQKcMFZdOu4LcpHgUd7e60oDc8+W/2bb8qMwdmTn1IIdVz7uCF a9XQAmA43s8bemxUd/d7+g+x+MLCYnMrwt3j7+YeZUj+qBYU3lMjoBFZ+guEWgMCgHIn n2zrqEnPFI288R/FhY3A7VRmHwvM03Naz+Pa5MvzHfCGOxSFzM2E52Xh8zPwnX7QJyAz 9m3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DlVNGvmFOuroNPsVcl6xee1wnTJNkNDxh9QND76iGNw=; b=uZd3Omlsjj4r4u6Nn8Qhgab7FD+OfP+DqndyypF0iP4skx6YeZzzdvEHfODlBpnCWc 3UwEuJnKyR98ejlp+EU6euLwuNefAd4jKG9PjC/daTc47Qxi/XEcay8MLgQybNvVzJoD 6jtrNaruI7QEos5gwEIoj9Yxih00CCG6madkS2soiIF9jkULJAzcMFgPAUsWr6jlf2WW Q+83YRpbGqj8g1WmUDDaMYyhz5y9hBqcGEHyklXHv90AoeSD+z1Z/OAhvc8LmxERvBOG RqFYl6AlbPbrXlDWoWz5sfC+CFQLhjXWtO65LNJUf3+z7Bgoa9iXuO5Z88TIsr9KsDVW 72ew== X-Gm-Message-State: AOAM532k81KU7rDom+lVMe7JRcKGoi3oLsn6QL/8VhtGEKdZuJwf4XuJ HxVbxe0NVAaqizVDhpvrPditgknQhS7lqg== X-Google-Smtp-Source: ABdhPJyqybwuby3mivuSv/RmIUMu5btJAaW8AyhWpLO2cOkV3CMaMoWp6ANHwRRVHh/WwOrqrrsCog== X-Received: by 2002:adf:db4d:: with SMTP id f13mr36657311wrj.336.1593788184952; Fri, 03 Jul 2020 07:56:24 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 7/9] util/compatfd.c: Only include if CONFIG_SIGNALFD Date: Fri, 3 Jul 2020 15:56:12 +0100 Message-Id: <20200703145614.16684-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER util/compatfd.c includes so that the CONFIG_SIGNALFD code can use SYS_signalfd. Guard the #include with CONFIG_SIGNALFD to avoid portability issues on hosts like Haiku which do not provide that header file. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth --- util/compatfd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/compatfd.c b/util/compatfd.c index c296f55d148..ee47dd80897 100644 --- a/util/compatfd.c +++ b/util/compatfd.c @@ -16,7 +16,9 @@ #include "qemu/osdep.h" #include "qemu/thread.h" =20 +#if defined(CONFIG_SIGNALFD) #include +#endif =20 struct sigfd_compat_info { --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788700; cv=none; d=zohomail.com; s=zohoarc; b=bVC6E6+ltRcKUBLo5OmAFtFw8utJlAwAti/Siv/j769iIXqCZx6OMiHuZZOzmd+wnLtqj9swc7czRd/V8UOVV5s7WD3boWQmHvqYGExfxln+6hezbGJ9VJ3ttovzKHBSzvU8knYbx+fhmXWSZq0HRL2Z/EM6lNq7cbPdoE1VYCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788700; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EaNr/NcUc3EkO5pc7J+JoEHPacZalxFiqmfKViYxLQc=; b=UD7mevGnHfAHF6q9AG7nnelUhhzF2ptnXR+jATmiJ0C8JIKJ9ZL1l4noebnkrD4FgfMveHKyW0cLAW38bcfwzDdiAFM0CpEx+FOAeopNrdCXwfgQalU67usquTX3ijVez1P3tQKzndIdnSXBp1XaeRX5/YASr6gcMNFNEiSdiZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788700261289.48201778997986; Fri, 3 Jul 2020 08:05:00 -0700 (PDT) Received: from localhost ([::1]:50920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNFL-0007K2-16 for importer@patchew.org; Fri, 03 Jul 2020 11:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN77-0003x9-BI for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:29 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:39265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN75-0006lm-JI for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:29 -0400 Received: by mail-wr1-x441.google.com with SMTP id q5so32990705wru.6 for ; Fri, 03 Jul 2020 07:56:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EaNr/NcUc3EkO5pc7J+JoEHPacZalxFiqmfKViYxLQc=; b=WK34UbPsiJAhbM4U7sGeEXGfhnC2L4r1teHd3RQGc4orARsedWYiEczyskRNErb9eo /FNtuHXN9IT5pe4tD6/SUxZbaQv5aIZjBK6qfaG87p9+eE8qObpXMRXR1MgvKG1/f2KR R4Sl1DF/G0Cmz5t6iviaPo/DorvnNiz/VaVRMQTxVXCOQRH2O22KLF93+TFmk0GwuyEw EoOv9oF8D8/jLeXvQsMy0RVQrMr8WoPHmgqpWe6AzuthKhk3s2ygOjO274Tx6VcNcoym 2bwcPzo3fJwwRzsv9Zil4+GA4Dlo0QYRnG3hQz9gp3/MIEb608kg/T5GSNM8O76qqbVc ud4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EaNr/NcUc3EkO5pc7J+JoEHPacZalxFiqmfKViYxLQc=; b=NP0pp0EOKEkcR+/zYBvKh6MzXaU4NvZ66iLJRXXa7vnQAXhCb729TcUz/AsYB+P1ee 7PThMFtAP/cyuJn9zr7cDYtgwFAhqqCbZuU+VMLLTh0OA7lA5MiaejT3//xQ7SD89eUp cWrwoIqCrDTYxuwgCBVzjSoNbWkTe2N297ezsIEQfSm1PgLMLtBKw1i2MWgJEFALjaCW V+yKvaXFzyzVSZXzvQiFMZGzvqlhpI5HoQRhORrksYQG3dxaax2SxanyZf4cRF5zgX7D j65UnEMZFD61WFsTPBlP3resoPvmRK1b+xQND8sfIjJmr5O/AZDr3Hv+gHuj9SK7pAat pExg== X-Gm-Message-State: AOAM533C5x5dwl2BmwjbxABy9rswWsk2OD6owU8HlS8kH+C7U9PJbBpn iKg1EBV35K5H00JRlnZtsZlyZ9dYS7PBFw== X-Google-Smtp-Source: ABdhPJwuJBRlJBDS62cwrqDoYGFqx8CZ9BOdmo4Li0lIDXjkYnmJWkqgAndajsII1qrNHXMQ8bjZAQ== X-Received: by 2002:a5d:6a01:: with SMTP id m1mr39565907wru.115.1593788186033; Fri, 03 Jul 2020 07:56:26 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 8/9] util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku Date: Fri, 3 Jul 2020 15:56:13 +0100 Message-Id: <20200703145614.16684-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: David CARLIER The qemu_init_exec_dir() function is inherently non-portable; provide an implementation for Haiku hosts. Signed-off-by: David Carlier [PMM: Expanded commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- util/oslib-posix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 7ad9195c445..72907d4d7fe 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -60,6 +60,10 @@ #include #endif =20 +#ifdef __HAIKU__ +#include +#endif + #include "qemu/mmap-alloc.h" =20 #ifdef CONFIG_DEBUG_STACK_USAGE @@ -389,6 +393,21 @@ void qemu_init_exec_dir(const char *argv0) } } } +#elif defined(__HAIKU__) + { + image_info ii; + int32_t c =3D 0; + + *buf =3D '\0'; + while (get_next_image_info(0, &c, &ii) =3D=3D B_OK) { + if (ii.type =3D=3D B_APP_IMAGE) { + strncpy(buf, ii.name, sizeof(buf)); + buf[sizeof(buf) - 1] =3D 0; + p =3D buf; + break; + } + } + } #endif /* If we don't have any way of figuring out the actual executable location then try argv[0]. */ --=20 2.20.1 From nobody Fri May 3 04:33:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1593788795; cv=none; d=zohomail.com; s=zohoarc; b=SsCk1++bcC7AKmYsi7FRlCzwSsxDTvHxfBdPmFXQzAmuBuuUgq5RzWBiFNZGniy0z5nwlwnm7Vb19y1m+SJPHLWQKq8kzNQ1dkCohSgCPI5zMIH6wzURlEfHf0JE4FtR1vMWRX+HmTXlc5jZl13CCetpPvAL/rE+VozkCEJLYII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593788795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gk9DfX8/J7tsyEjRqdyCEtDuVKOgNFwSPI5bE1k8yEs=; b=kb8qEiy2lC6I9Gp4n27t5vvmeydqLGAs7webTEQlfZZjV7H3i5gQe1WnTQJ0VTbzddJJdKZ1vZY/Gtu9yzTykKw2GEf/87ruHvy+AVPNuqx4P8pgTh52x2R3Uargu/GdCQWtYNjdmweEV3AsXQ16dp589K5JOUdGx04FPDK8dhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593788795275873.4985931251654; Fri, 3 Jul 2020 08:06:35 -0700 (PDT) Received: from localhost ([::1]:54520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrNGr-00026R-Vr for importer@patchew.org; Fri, 03 Jul 2020 11:06:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN78-00040i-QX for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:30 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:38953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrN77-0006lx-18 for qemu-devel@nongnu.org; Fri, 03 Jul 2020 10:56:30 -0400 Received: by mail-wr1-x42f.google.com with SMTP id q5so32990804wru.6 for ; Fri, 03 Jul 2020 07:56:28 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id s10sm14078347wme.31.2020.07.03.07.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 07:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gk9DfX8/J7tsyEjRqdyCEtDuVKOgNFwSPI5bE1k8yEs=; b=FkZQs4i0PHggkH+l63CrOMoMBhq9V5ogNKc4p3ieY+RNtdv4WEm/yrsWep4uhDWDzm /3D6yka2A25eN0Pn4xCB2TtSO+IbsGjbiKJBXsBw02ft/ztfvb8rN7r6P/1ESRGmczW7 iJquQ3dISjPJwwfjHwhGLBBG9GrP3M7BIGoXquH3p7s6og2ZwmN9MymKuJPQSu3OAVHU mUME1CWcFoNXkZkdonaAbBbWj0qTtFpwrKEPF9wPw+N7rPgmETQs/IpZnBPO+xJyIGYP 6YgJAAI8gmj69MYl+A8ND/jtSnW58U8ixXdJ3fh83gzkfl9CcpFNMKk8fk1vSenC6K1N hG7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gk9DfX8/J7tsyEjRqdyCEtDuVKOgNFwSPI5bE1k8yEs=; b=asmkPBIdrO4JfIvhs5hx7EHmRvQP9u6pdc1owrMrpnp/gb8RKWRz+5MNVySTyXEm6r ojUkjqAEwYY7Fx+oNo70Gi4tnmQt6QiptZ7agu4ttIQACxG+TjHKMkZu8eX78ZyP+LUT 06GRnNfiXcU8ovRUIOHVB1SJixfIa1bRkRNd+7/Mc4u+5Y5n5sUuFaw/VIwmFi7BSQpS C5CQKcMqB8da2hMKq3QWb63joptVOUu1M5QNRWpVl/36oelSK9r8U2wSS0NxRL8qXEoP ddhM+/QoOHUiclt8HdbJIcw5JLDQ/z34M419Ddsd+tYvVuxF3z56pcGoMAcipNdCG23b W4YA== X-Gm-Message-State: AOAM531pn2PnXuYTUbEBul/xSncktQTvGiaa/OtXIb7KqAgYytiJzPTC WVz6WD4qsmGdBeKn8WnNMcYD8qwxRNqapw== X-Google-Smtp-Source: ABdhPJyh0dEc+Eeo/RagW5rmlqA1a9tbCn2u3bTGfgPAV4XnR61zmqHnKRCPjz0XxmyazviqlzF4Ag== X-Received: by 2002:adf:ea0f:: with SMTP id q15mr7538607wrm.113.1593788187319; Fri, 03 Jul 2020 07:56:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 9/9] util/drm: make portable by avoiding struct dirent d_type Date: Fri, 3 Jul 2020 15:56:14 +0100 Message-Id: <20200703145614.16684-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703145614.16684-1-peter.maydell@linaro.org> References: <20200703145614.16684-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Carlier , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Gerd Hoffmann Given this isn't perforance critical at all lets avoid the non-portable d_type and use fstat instead to check whenever the file is a chardev. Signed-off-by: Gerd Hoffmann Reported-by: David Carlier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20200701180302.14821-1-kraxel@redhat.com [PMM: fixed comment style; tweaked subject line] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- util/drm.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/util/drm.c b/util/drm.c index a23ff245382..dae8ffebc81 100644 --- a/util/drm.c +++ b/util/drm.c @@ -24,7 +24,8 @@ int qemu_drm_rendernode_open(const char *rendernode) { DIR *dir; struct dirent *e; - int r, fd; + struct stat st; + int r, fd, ret; char *p; =20 if (rendernode) { @@ -38,10 +39,6 @@ int qemu_drm_rendernode_open(const char *rendernode) =20 fd =3D -1; while ((e =3D readdir(dir))) { - if (e->d_type !=3D DT_CHR) { - continue; - } - if (strncmp(e->d_name, "renderD", 7)) { continue; } @@ -53,6 +50,18 @@ int qemu_drm_rendernode_open(const char *rendernode) g_free(p); continue; } + + /* + * prefer fstat() over checking e->d_type =3D=3D DT_CHR for + * portability reasons + */ + ret =3D fstat(r, &st); + if (ret < 0 || (st.st_mode & S_IFMT) !=3D S_IFCHR) { + close(r); + g_free(p); + continue; + } + fd =3D r; g_free(p); break; --=20 2.20.1