Richard L. Hamilton wrote: >James Carlson wrote: >> For what it's worth, I would use >> fork()/setsid()/fork() to disclaim a >> controlling tty. It's simple and always works. >> (Though, notably, it >> oes not get you outside of an existing contract, >> which is sometimes an >> important distinction for programs that operate as >> daemons.) > > That's exactly what I wanted to avoid, using a sort of > semi-daemonizer program that would leave backgrounding > up to the invoker, so that if the invoker wished, it could > collect status to discover any failures. That's a little > tricky to do with fork()/setsid()/fork(), taking into account > the possibility of non-zero return codes or signals (with or without > core dumps).
That's what Solaris contracts are (at least partly) about. They allow you to monitor children that may go through multiple forks. I can't say I'd recommend TIOCNOTTY for any new code intended to run on Solaris. But good luck. ;-} -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code