Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!decvax!harpo!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.unix-wizards Subject: New? idea Message-ID: <4771@umcp-cs.UUCP> Date: Sun, 15-Jan-84 18:43:17 EST Article-I.D.: umcp-cs.4771 Posted: Sun Jan 15 18:43:17 1984 Date-Received: Mon, 16-Jan-84 05:21:45 EST Organization: Univ. of Maryland, Computer Science Dept. Lines: 28 Something that network servers often do is while ((netfd = netopen ()) >= 0) { if ((pid = fork ()) == 0) { if (fork ()) exit (0); workhorse (); exit (0); } close (netfd); } The purpose of the double-fork is to "disown" the actual worker and let the server continue to accept network connections. Without the "disownment", when the "workhorse" finishes and exit()s, it hangs around forever taking up a process slot, just so that it can return its status to its parent. But the server doesn't care, ergo the double-fork-be- inherited-by-init trick. So, my suggestion is a "disown" system call, to allow parents to give up their children so that on exit they will vanish without a trace. Does anyone know why this should not be implemented (other than because you can do it without this)? Alternatively, does anyone have better ideas? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris.umcp-cs@CSNet-Relay