>David, > >I've been tossing around the idea of introducing a function that >provides something close to being equivalent to daemon(3)[1] in >BSD to simplify the work needed to make a program run as a daemon. > >The presence of contracts in OpenSolaris makes it seem necessary >to add a 3rd argument to this, indicating whether or not you want >the daemon to have its own contract. Is there a requirement for >more options than just this, or just more flexibility in this? > >Would the work done in sshd shape up to be a good model for what >should be done in such a function?
The daemon() function is clearly a broken interface as proven by your suggestion to add a 3rd argument. It is non-extensible and uses two Boolean arguments. A function which take flag arguments and which is possibly variadic sounds better. And then providing daemon() as a wrapper could be part of such a thing too. Casper