From nobody Mon Sep 28 00:51:54 2026 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=comstyle.com ARC-Seal: i=1; a=rsa-sha256; t=1789455023; cv=none; d=zohomail.com; s=zohoarc; b=WBf18cMBF3o8O+0Daz1RmIKaR0CF+z00KsUlQrtY0R97VfULGTzeMHZ8n75DkHOuUKLTEp203lB2l7Pu5eae5xYqNouN1rkDdK4oVyat+X3vM5D7e+GvZWOTisfNohb9Ci7AyBhhIO5QH1YbxGV19wRCdhPGMK1xdo8he3AUj/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789455023; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BQ1tewnrhrMpVegqQP2dLT8OuJLjArAa2shXbA6FmXE=; b=l+co9QD+424u8/TUQqQsaT+DgTNh3aR5MUYlnsCDo/+ivOnCN0+wCPMc7cCaq8kQiQXlqsw6k4EwkxbBVRYBwtN5zKefKkkj24BJqcaMLoAT8DbbQNHM5T7LbEL1NIc5UhdOwZhaqPO1eFiVl5RIJpVjVZ9mPVjF+JCOCQw2beM= 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) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789455023766796.522048596853; Mon, 14 Sep 2026 23:50:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6MzD-0000TX-KN; Tue, 15 Sep 2026 02:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6MzC-0000T8-23 for qemu-devel@nongnu.org; Tue, 15 Sep 2026 02:49:46 -0400 Received: from speedy.comstyle.com ([2607:f938:3000:8::2] helo=mail.comstyle.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1x6MzA-0003yK-LS for qemu-devel@nongnu.org; Tue, 15 Sep 2026 02:49:45 -0400 Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4hkXgh26dSz8PbS; Tue, 15 Sep 2026 02:49:36 -0400 (EDT) Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:73f1:f873:95ea:a09a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4hkXgh012mz8PbR; Tue, 15 Sep 2026 02:49:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=comstyle.com; h=date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=tbXRKZUzA9S1VKs/qJ4uRJ0qKqE0TWHc4lb5tFj9BhQ=; b=PSeT 0Nf6njZ3q+BWgXE4UQLqMVLfuVY8EYlfynIB+fqXM0bVoCLErNTIOovMagnr86+w IhDNveIO/oqcAdcoSG+SJiccR5GNhaewfrdImLT9N8HrXjMwxX+jmsVVCE35ZEqe dWxTE9sXb5NgSXUEhdHYGsu/eBtx5/4N8NQW4Jw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :cc:subject:message-id:mime-version:content-type; q=dns; s= default; b=SzIBf9YaSmscI/auv3pGc2esOMiOE7vMN7RK+h7nDzlLzC1E/59O7 vA4mlKubVIZ8VThKkmq0FaZ0cZWHHl5ptFwlR+BzxkqOHG3i7GLmBK83vK1ypKW6 Ow3aYrYZHgumMGBu5Gpj4nnTyH6a3ayb7ikxNdeaItBhWuiG10t6ok= Date: Tue, 15 Sep 2026 02:49:34 -0400 From: Brad Smith To: Paolo Bonzini , Marc-Andr_ Lureau , "Daniel P. Berrang_" , Pierrick Bouvier Cc: qemu-devel@nongnu.org Subject: [PATCH] util/cutils: Use getexecpath() on OpenBSD for qemu_init_exec_dir() Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f938:3000:8::2; envelope-from=brad@comstyle.com; helo=mail.comstyle.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-0.2.13.1.5.4/289.450.80 X-ZohoMail-DKIM: pass (identity @comstyle.com) X-ZM-MESSAGEID: 1789455025698158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" util/cutils: Use getexecpath() on OpenBSD for qemu_init_exec_dir() OpenBSD has introduced a function getexecpath() to be able to retrieve the executable name and path. Signed-off-by: Brad Smith --- meson.build | 8 ++++++++ util/cutils.c | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/meson.build b/meson.build index cfac634cf1..0e07138b0c 100644 --- a/meson.build +++ b/meson.build @@ -3034,6 +3034,14 @@ config_host_data.set('CONFIG_ELF_AUX_INFO', cc.links= (osdep_prefix + ''' return hwcap; }''')) =20 +config_host_data.set('CONFIG_GETEXECPATH', cc.links(osdep_prefix + ''' + #include + #include + int main(void) { + char buf[PATH_MAX]; + getexecpath(buf, sizeof(buf)); + }''')) + config_host_data.set('CONFIG_USBFS', have_linux_user and cc.compiles(''' #include =20 diff --git a/util/cutils.c b/util/cutils.c index 91ddadfd15..b5d1d13e24 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1091,6 +1091,12 @@ void qemu_init_exec_dir(const char *argv0) p =3D buf; } } +#elif defined(__OpenBSD__) && defined(CONFIG_GETEXECPATH) + { + if (getexecpath(buf, sizeof(buf)) =3D=3D 0) { + p =3D buf; + } + } #elif defined(__APPLE__) { char fpath[PATH_MAX]; --=20 2.55.0