std.process - POSIX specific callback

Lars T. Kyllingstad public at kyllingen.net
Thu Jun 6 22:59:22 PDT 2013


On Thursday, 6 June 2013 at 17:32:25 UTC, nazriel wrote:
> I am aware that std.process is generalized but I doubt such 
> useful functionality which is usable on various Posixen is more 
> disturbing than Windows-only suprpressConsole 
> https://github.com/D-Programming-Language/phobos/blob/master/std/process.d#L954

I think there is a huge difference between a simple flag and the
ability to execute arbitrary code on one OS but not on another.
(When set, suppressConsole actually *eliminates* a difference in
the default behaviour of the two OS families.)

> But I was mistaken. Config is an enum not struct, so yeah, not 
> worth changing it only for sake of posix callback.
>
> So maybe module level variable?
>
> module std.process;
>
> // ...
> void delegate() posixPostFork = null;
> // ...

Global state?  Don't want to go there...


> I would *really* love to see this implemented. It is really 
> basic stuff for posixen.

It needs a good API and community support.  I don't think we
should introduce new functionality, that looks like it was bolted
on, because one person said they really needed it.

Is it possible to abstract the things you would like to do in
such a callback?  You mention privilege lowering as a use case.
Can we make an API that does this, and which modifies the
process' security context in Windows in an equivalent/similar
way, for instance?


More information about the Digitalmars-d mailing list