Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.netbsd.tech.userlevel > #11973

Re: Proposal: getexecpath(3)

From Taylor R Campbell <riastradh@NetBSD.org>
Newsgroups muc.lists.netbsd.tech.userlevel
Subject Re: Proposal: getexecpath(3)
Date 2026-10-26 07:29 +0000
Organization Newsgate at muc.de e.V.
Message-ID <20261026072940.AC5DF84D2D@mail.netbsd.org> (permalink)
References <210e9bde-0c69-4db4-9b68-6a78bf3ad615@comstyle.com>

Show all headers | View raw


> 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

Back to muc.lists.netbsd.tech.userlevel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Proposal: getexecpath(3) Brad Smith <brad@comstyle.com> - 2026-10-25 04:20 -0400
  Re: Proposal: getexecpath(3) Taylor R Campbell <riastradh@NetBSD.org> - 2026-10-26 07:29 +0000
    Re: Proposal: getexecpath(3) Mouse <mouse@Rodents-Montreal.ORG> - 2026-10-26 07:04 -0400
      Re: Proposal: getexecpath(3) Taylor R Campbell <riastradh@NetBSD.org> - 2026-10-26 12:17 +0000
        Re: Proposal: getexecpath(3) Mouse <mouse@Rodents-Montreal.ORG> - 2026-10-26 19:12 -0400
          Re: Proposal: getexecpath(3) Jason Thorpe <thorpej@me.com> - 2026-10-27 08:59 -0400
        Re: Proposal: getexecpath(3) David Holland <dholland-tech@netbsd.org> - 2026-11-01 19:34 +0000

csiph-web