[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Clarification about bug #463538 is needed



On Sun, Jul 20, 2008 at 09:14:48AM +1000, Brian May wrote:
> Apart from what everyone else has said, I can't help put being slightly
> puzzled that it calls fork two times. This just seems weird...
>
> Or did I miss something?

See chapter 13 from "Advanced Programming in the UNIX Environment"
(ISBN 0201563177):

"Under System V–based systems, some people recommend calling fork
again at this point and having the parent terminate. The second
child continues as the daemon. This guarantees that the daemon is
not a session leader, which prevents it from acquiring a controlling
terminal under the System V rules (Section 9.6). Alternatively, to
avoid acquiring a controlling terminal, be sure to specify O_NOCTTY
whenever opening a terminal device."
-- 
{ IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657);
SMTP(fungi@yuggoth.org); IRC(fungi@irc.yuggoth.org#ccl); ICQ(114362511);
AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(fungi@yuggoth.org);
MUD(fungi@katarsis.mudpy.org:6669); WWW(http://fungi.yuggoth.org/); }


Reply to: