Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!wuarchive!udel!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: Answer on sockets; Question on screen under SunOS 4.[01] Message-ID: <10077:Nov1523:37:0790@kramden.acf.nyu.edu> Date: 15 Nov 90 23:37:07 GMT References: <7122:Nov1408:21:1690@kramden.acf.nyu.edu> <2212@kraftbus.opal.cs.tu-berlin.de> Organization: IR Lines: 29 In article <2212@kraftbus.opal.cs.tu-berlin.de> net@tubopal.UUCP (Oliver Laumann) writes: > Huh? What does the problem that was described in the original article > have to do with the way pseudo-ttys are allocated in screen? It has everything to do with it. I had many reports of the same problem with pty. What happens is that the process running under the pseudo-tty is in what POSIX calls an ``orphaned process group,'' because it's in a different session from its parent. You know how orphaned processes are killed when they're stopped? Well, POSIX requires that this also happen to processes in an orphaned process group, even if the parent is around. This requirement is unreasonable, useless, and unnecessarily hurts lots of existing programs, but it's what the standard says. Now that pty works around the problem, all code using it will be portable to SunOS 4.1 (and Ultrix 4.0 and Convex UNIX 8.0, which have the same behavior). This is why encapsulating pseudo-tty management into a single program is so useful: no other program ever has to worry about pseudo-tty portability again. > Instead of trying to convince me to change screen's pseudo-tty > allocation code I would appreciate if someone could tell me under what > conditions exactly the SunOS kernel kills a process, so that I can try > to put a work-around into screen (unfortunately we don't have the SunOS > sources, so I can't look that up myself). And this is what happens when you refuse to make your programs portable by taking advantage of what's available. ---Dan