Answer on sockets; Question on screen under SunOS 4.[01]

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Nov 16 10:37:07 AEST 1990


In article <2212 at kraftbus.opal.cs.tu-berlin.de> net at 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



More information about the Comp.unix.questions mailing list