C++ Logo

sg16

Advanced search

Re: [isocpp-lib-ext] std::environment

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Mon, 2 Jan 2023 14:54:12 +0100
On 02/01/2023 03.31, Jeff Garland via SG16 wrote:
> Thanks for posting this Tom — really good paper input :) I’ve indeed started drafting an outline and this is *way harder/worse* than I hoped. I *think* I agree with most everything that’s been said so far — here’s my summary so of directional thoughts so far:
>
> 1) It is a non-negotiable requirement for std::process — a different proposal I’ll be restarting — to write the environment before launching a child process — Ville and Jake's points. There simply is no standard way to do it currently — putenv, unsetenv is posix only. No matter what I think this should be fixed.

Are we talking about (the combination of) fork + exec
(i.e. a new program image is being executed), or
about fork alone?

If the former, we do need the ability to define the
environment of the new process, but it seems wrong
on so many levels to change the environment of the
current process to make that happen.

For example, my Linux box has execvpe to pass
a fresh environment to the new process.

Jens

Received on 2023-01-02 13:54:22