Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 1996 17:48:19 GMT
From:      James Raynard <fports@jraynard.demon.co.uk>
To:        rich@rich.isdn.bcm.tmc.edu
Cc:        freebsd-ports@freebsd.org
Subject:   Re: emacs 19.31
Message-ID:  <199607011748.RAA01635@jraynard.demon.co.uk>
In-Reply-To: <199607010039.TAA04385@richc.isdn.bcm.tmc.edu> (message from Rich Murphey on Sun, 30 Jun 1996 19:39:59 -0500 (CDT))

next in thread | previous in thread | raw e-mail | index | archive | help
> For some reason, in an emacs shell buffer the TIOCGPGRP
> ioctl fails.  That is, you cannot find the current
> process group.  The program below fails within an emacs
> shell buffer but not in an 'rsh' buffer or xterm, etc.

I found this question in volume 22 of comp.std.unix:-

"POSIX apparently specifies that the TIOCGPGRP ioctl is disabled if
called on a terminal other than the controlling terminal of the
calling process, apparently for security reasons. This behavior breaks
the subshell handling of GNU Emacs, and apparently interferes with the
operation of the XView terminal emulator as well.  GNU Emacs uses ptys
to communicate with shell subprocesses, and attempts to send signals
to the foreground process in a subshell by finding the process group
associated with the (master side of the) pty."

which received the following answer from the moderator (our very own sef):-

"First of all, emacs needs to do a setsid() in the sub-process; this makes
the pty it's controlling terminal (at least, this is how it works under
SCO's unix).

Second of all, because of the problem with tcgetpgrp() on another process'
pty, I added (for my own use) a new ioctl to the pty driver, called TIOCSIG
(as in, ioctl(fd, TIOCSIG, signo)), which sends an arbitray signal to the
process group on fd.  (Since I did it only for emacs, I didn't put in any
checks for security, although I plan on doing so eventually.)

I got this idea from a discussion with people at Berkeley."

Don't know if this helps or not - it's not really feasible for me to
download the entire emacs-19.31 tarball (and even if I did, I wouldn't
have any room to unpack it). :-(

-- 
James Raynard, Edinburgh, Scotland
james@jraynard.demon.co.uk
http://www.freebsd.org/~jraynard/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607011748.RAA01635>