Path: utzoo!attcan!uunet!snorkelwacker!paperboy!osf.org!lwa From: lwa@osf.org (Larry Allen) Newsgroups: comp.unix.wizards Subject: Re: process group of tty** Message-ID: <5525@paperboy.OSF.ORG> Date: 26 Mar 90 20:14:34 GMT References: <1990Mar26.173414.28049@zardoz.cpd.com> Sender: news@OSF.ORG Reply-To: lwa@osf.org (Larry Allen) Organization: Open Software Foundation Lines: 19 GNU Emacs does this, on 4.xBSD systems, by using ioctl(TIOCGPGRP) on the master side of the pty. This counts on the TIOCGPGRP on the master side actually returning the process group associated with the slave side of the pty. This always struck me as being suspect, but there's no other way to do it that I know of. Ideally, perhaps, there would be a set of ioctl's that were specific to pty's that allowed the controlling process to inquire and change slave side attributes via the master pty, but (aside from REMOTE and PACKET modes) there aren't any such ioctl's today. I had occasion to look into this code because it broke as a result of the 4.4BSD changes to support Posix semantics; the 4.4bsd implementation supports TIOCGPRGP as a layer on the Posix tcgetpgrp() call (or the other way around -- I forget which), and Posix mandates that tcgetpgrp() must only work on the process' controlling TTY. Emacs, of course, didn't check for this error, and as a result was silently unable to signal subjobs. -Larry Allen Open Software Foundation