[PATCH] tfork

Jeremy Allison jra at samba.org
Wed Apr 19 21:57:53 UTC 2017

On Tue, Apr 18, 2017 at 09:55:56PM +0200, Ralph Böhme via samba-technical wrote:
> Hi!
> Attached is a patchset that adds a signal and waitpid() avoiding fork()
> replacement: tfork().
> It was based on an older patchset from metze, called double_fork at that time,
> that I extended to fork three-times in order to return a pollable status fd.
> It's intented use is in samba_runcmd_send() where it avoids calling waitpid()
> and dealing with SIGCHLD to get the exit status of the executed command.
> With this change it is safe to call samba_runcmd_send() in smbd code as an async
> replacement for smbrun().
> I have a usecase here where someone wants to run shell scripts from source3
> code without blocking.
> Please review & push if happy.

Finally reviewed, LGTM. Pushed.

Still want to discuss the CatchSignal() issue though :-).

More information about the samba-technical mailing list