Newsgroups: comp.os.minix
Subject: Question about process group handling
Organization: Syracuse University, Syracuse
From: mcconnel@hydra.syr.edu (Terry R. McConnell)
NNTP-Posting-Host: hydra.syr.edu
Message-ID: <379882e1.0@news.syr.edu>
Date: 23 Jul 1999 10:57:37 -0500
X-Trace: 23 Jul 1999 10:57:37 -0500, hydra.syr.edu
Lines: 24
Path: star.cs.vu.nl!newsfeed2.news.nl.uu.net!newsfeed1.news.nl.uu.net!sun4nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.syr.edu!hydra.syr.edu!mcconnel
Xref: star.cs.vu.nl comp.os.minix:36009


I'm a bit confused about the handling of a terminal's process group field
( tty_pgrp field of a struct tty. ) My understanding is that this should
hold the process number of the session leader, i.e., the FIRST process that
opened the terminal. However, from the source code for do_open, specifically
lines 12185-12188, it appears that any process subsequently performing
an open on a terminal line will have its process number displace that of
the session leader. 

Suppose, e.g., we run a program like crypt at a shell command line:

# crypt < plain_text > cipher_text

Here I would guess the session leader would be the user's login shell. Crypt
must do an open of the controlling terminal in order to get the encryption
key from the user. So after it exits, what resets tty_prgp to its original
value?  Is this handled somehow at a higher level (in MM ?) I couldn't see
where.

-- 
************************************************************************
Terry R. McConnell   Mathematics/304B Carnegie/Syracuse, N.Y. 13244-1150
trmcconn@syr.edu                            http://barnyard.syr.edu/~tmc 
************************************************************************
