[Mono-dev] System.Unix.Native.Syscall.fork is commented out

Sixes cliff at may.be
Mon Nov 3 17:49:16 EST 2008

Jonathan Pryor wrote:
> On Wed, 2008-09-03 at 10:33 +0200, Robert Jordan wrote:
> Alas, I didn't get any further details, but that was enough for me to
> remove fork() from Syscall: if it can't ever be reliably called, then it
> shouldn't be callable.

Sorry about jumping in two months late on this thread.

It seems to me that the one valid reason to fork() is to detach from the
controlling terminal. This can (and should) be done before starting any
threads other than Main(). So long as it is done right at the beginning, it
seems unlikely it will cause problems.

I'm now trying to use mono for all new Unix projects where previously I
would have used perl. Frankly I don't want to have to build a Windows-style
service for a program that's only going to run on Unix. I want to check for
a -d flag and, if it's there, become a daemon.

If you don't want to put System.Unix.Native.Syscall.fork() back in, how
about a simple, static System.Unix.Native.Daemon class? It could be
documented as only usable as the first call in Main().


View this message in context: http://www.nabble.com/System.Unix.Native.Syscall.fork-is-commented-out-tp19282423p20312647.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

More information about the Mono-devel-list mailing list