Article View: gnu.emacs.bug
Article #99315(none)
From: nixpbe!uucp
Date: Sun, 14 Oct 1990 20:59
Date: Sun, 14 Oct 1990 20:59
100 lines
4485 bytes
4485 bytes
>From uucp Mon Oct 15 03:53 WST 1990 remote from nixsin
To: nixpbe!unido!gnu-emacs-bug
Path: nixsin!nixpbe!unido!mcsun!uunet!snorkelwacker!tut.cis.ohio-state.edu!relay.eu.net!dutentb!stravers
From: dutentb!stravers@relay.eu.net
Newsgroups: gnu.emacs.bug
Subject: bug in sig_process() on HPUX 7.0
Message-ID: <9010010837.AA15646@hp4nl.nluug.nl>
Date: 1 Oct 90 10:30:27 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: stravers@dutentb.tudelft.nl
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 84
Posted: Mon Oct 1 11:30:27 1990
Following reports a bug in GNUemacs 18.55 for HPUX. A patch is included.
Program: GNU emacs 18.55
Operating system: HPUX 6.5 and HPUX 7.0
Hardware: hp9k800, hp9k300
Problem:
Emacs is unable to send signals to inferior processes, as required for the
elisp functions interrupt-process, kill-process, etc. Consequently, \C-c\C-c in
shell-mode does not send signal 2 to the shell's subjob, in latex-mode \C-c\C-k
does not kill the running latex process, etc.
Cause -- where it fails:
The following system call in the file src/process.c, function sig_process()
fails:
if (!NULL (current_group))
{
>>> ioctl (XFASTINT (p->infd), TIOCGPGRP, &gid); <<<<<<<< FAIL *****
gid = - gid;
}
The call is supposed to set gid to the process group id of the process that is
currently in the foreground of the controlling terminal whos fildes is p->infd.
In stead, ioctl returns -1 and sets errno to ENOTTY. According to the manual
page termio(7) this means that "the file associated with XFASTINT(p->infd) is
not the controlling terminal, or the calling process does not have a
controlling terminal". Here the "calling process" is emacs and the file
descriptor XFASTINT(p->infd) refers to the master side of the pty that emacs
uses to communicate with the inferior process.
Cause -- why it fails:
It seems that hpux only allows background processes WITHIN a terminal session
to obtain the gid of that sessions current foreground process. Since the
inferior process creates its own session just after emacs forks [with the call
setpgrp()], emacs is OUTSIDE the inferior process session, hence the above
mentioned ioctl fails.
Suggested solution:
In hpux we can (must) combine the two distinct calls
1. ioctl ( fildes, TIOCGPGRP, &gid);
2. kill (-gid, signo);
into the single call
1+2. ioctl( fildes, TIOCSIGSEND, signo);
According to the man page pty(7) this sends the signal signo to the current tty
process group of the pty slave side. Here are the cdiffs:
*** process_old.c
--- process.c
**************
*** 1819,1824
Must do that differently. */
killpg (-gid, signo);
#else /* Not BSD. */
kill (gid, signo);
#endif /* HPUX */
#endif /* Not BSD. */
--- 1819,1827 -----
Must do that differently. */
killpg (-gid, signo);
#else /* Not BSD. */
+ #ifdef HPUX /* previous ioctl failed, gid is not valid */
+ ioctl( XFASTINT (p->infd), TIOCSIGSEND, signo);
+ #else
kill (gid, signo);
+ #endif /* HPUX */
#endif /* Not BSD. */
Two notes on the patch:
1. After this patch sig_process() still executes the failing ioctl, but since
we discard the resulting gid anyway this does no harm.
2. These diffs apply to the file src/process.c AFTER I patched it with Piet
van Oostrum's (piet@cs.ruu.nl) patches to make ^G work for HPUX/X-windows.
If you cannot get them, mail me and I'll send 'm to you.
Paul Stravers
Delft University of Technology (faculty of EE)
The Netherlands
__ __ __
____/ |____ | \_paul__ _ __/ \_____
|____| |___/ \__stravers@dutentb.tudelft.nl__/
Technical Details
Message-ID:
<9010142059.AV10961@unido.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!relay.eu.net!nixpbe!uucpShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,b5ec764478ce47e0 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-10-14 13:59:01 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!relay.eu.net!nixpbe!uucp From: nixpbe!uucp@relay.eu.net Newsgroups: gnu.emacs.bug Subject: (none) Message-ID: <9010142059.AV10961@unido.informatik.uni-dortmund.de> Date: 14 Oct 90 20:59:01 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 100 Approved: bug-gnu-emacs@prep.ai.mit.edu Posted: Sun Oct 14 21:59:01 1990