Re: Proposal: getexecpath(3)

Rob Whitlock <[email protected]> Mon, 6 Jan 2025 17:26:05 -0500
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
> On Jan 5, 2025, at 9:24 PM, David Holland <[email protected]> wrote:
> 
> On Sun, Jan 05, 2025 at 04:24:23AM +0100, Jean-Yves Migeon (NetBSD) wrote:
>> Also all argv[] strings can be modifiable by callee. pathname of the
>> execution (as passed to execve(2) or like) is not.
> 
> So?
> 
> (also, that's UB in C so the traditional Unix behavior is not by any
> means guaranteed, and on NetBSD you should be using setproctitle(3)
> for that instead anyhow)

What exactly is UB in C? Since execve(2) is not part of ANSI/ISO C, I presume you might be talking about modification of the argv[] strings? But that is explicitly allowed, and not UB.