std.process - POSIX specific callback

Lars T. Kyllingstad public at kyllingen.net
Mon Jun 10 13:05:15 PDT 2013


On Monday, 10 June 2013 at 16:20:53 UTC, Steven Schveighoffer 
wrote:
> But I think we need some way to hook this.  To give up all the 
> niceties of std.process just so you can hook the fork/exec 
> sequence seems overly burdensome.

But with the pthread_atfork() solution you don't have to.  Call 
that function before you call spawnProcess() or any of the other 
std.process functions, and it should Just Work (TM).  The nice 
thing here is that it is already part of the POSIX standard, and 
thus should be available on all relevant systems, and we don't 
have to adapt our cross-platform API at all.


More information about the Digitalmars-d mailing list