🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.netbsd.tech.userlevel
Article #41

Re: Proposal: getexecpath(3)

#41
From: Taylor R Campbell
Date: Mon, 26 Oct 2026 07:29
37 lines
3522 bytes
> Date: Sun, 25 Oct 2026 04:20:57 -0400
> From: Brad Smith <brad@comstyle.com>
> 
> So the name is the same, but both the signature and the semantics
> differ from what is proposed here: a canonical absolute path rather
> than the verbatim execve(2) argument. If NetBSD goes ahead with
> this, it would be good to either match OpenBSD's interface or pick a
> different name.

Why do you want the kernel to compute some notion of a canonical
absolute path?  Of what use is this for applications?  Isn't this
strictly less useful than the original verbatim exec path?

You can always pass the original verbatim exec path to realpath(3) if
you want to canonicalize it, but you can't undo realpath(3) (or the
kernel's equivalent) if the program wants to use the same symlinks for
to (dl)open supporting data and libraries as the caller used to
execute the program.

I think it is a mistake for the kernel to expose anything other than
the original verbatim exec path.

(I don't have strong feelings about char *getexecpath(void) vs void
getexecpath(char *, size_t); the first one is a little simpler, but
whatever.)

> Portable software is already starting to probe for getexecpath()
> (HAVE_GETEXECPATH checks in configure/meson/CMake), and two
> incompatible functions under the same name would be an unpleasant
> trap.

Sounds like the `portable' software needs #ifdef __OpenBSD__, since
API this isn't portable to any platform except OpenBSD anyway?

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <20261026072940.AC5DF84D2D@mail.netbsd.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <210e9bde-0c69-4db4-9b68-6a78bf3ad615@comstyle.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Taylor R Campbell <riastradh@NetBSD.org>
Newsgroups: muc.lists.netbsd.tech.userlevel
Subject: Re: Proposal: getexecpath(3)
Date: Mon, 26 Oct 2026 07:29:39 +0000
Organization: Newsgate at muc.de e.V.
Sender: tech-userlevel-owner@NetBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <20261026072940.AC5DF84D2D@mail.netbsd.org>
References: <210e9bde-0c69-4db4-9b68-6a78bf3ad615@comstyle.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="70787"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1792999783;
	bh=+Xb174LUMeqwQWUc1/y73EyhV+hF6/B0Fc+3YgzMzYg=;
	h=To:CC:In-reply-to:Subject:Date:From:List-Id:List-Unsubscribe;
	b=1Ud1lnYvSE1ux54VVsHMSTPZgvvIP/y3LA0fy/d5RB92D64PbpMlHDk69VxycYL58
	 Y6Lwlg61GGwCe1xmC1Juqmyy3THRlGFKcddaSYwldjkRn1sOxBn6JiomPiYwlaGPg/
	 QkV80DiTDo5idVGJR/TZxrJOxZWwBV9hmCFkcRMg=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1792999780;
	bh=+Xb174LUMeqwQWUc1/y73EyhV+hF6/B0Fc+3YgzMzYg=;
	h=To:CC:In-reply-to:Subject:Date:From;
	b=daybSN+jK0ivHF9dqsH57SmoX4ueJ9wwqh/k2X8JbWdcbpAJUUAWIaXJrM6P8YEdT
	 lUYopP8xw0KwyeJTqUc9rGV/kroGBDdr0jzdrywaggDeaoWlc34Xf/oo6Ps0oGZ1T+
	 ae/nH+PUmnE/O5NQ4qONpd8I6AbbGD3kDAOCzwuE=
In-reply-to: <210e9bde-0c69-4db4-9b68-6a78bf3ad615@comstyle.com> (brad@comstyle.com)
Precedence: bulk
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes