Article View: gnu.emacs.bug
Article #99804setpgrp
From: eirik
Date: Tue, 08 May 1990 01:06
Date: Tue, 08 May 1990 01:06
32 lines
1822 bytes
1822 bytes
Without the enclosed patch, a shell window cannot open /dev/tty if the
parent emacs process has no controlling terminal (one way to start
such an emacs is to open an X11 window using rsh). In SunOS 4.1, such
a shell window doesn't work at all; the shell stops immediately.
According to the SunOS 4.1 release manual, this is the right way to
detach a process from its controlling terminal, in BSD 4.3 and
earlier. The manual explicitly states that code like the code before
this patch is no longer supported in SunOS 4.1. It is also possible
to use setsid instead, but that way is not backward compatible. I
don't know if the #ifndef USG is necessary here, but I doubt it can
hurt anything.
*** process.c~ Sun Aug 6 18:01:31 1989
--- process.c Mon May 7 20:46:03 1990
***************
*** 1029,1038 ****
--- 1029,1041 ----
/* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here?
I can't test it since I don't have 4.3. */
int j = open ("/dev/tty", O_RDWR, 0);
ioctl (j, TIOCNOTTY, 0);
close (j);
+ #ifndef USG
+ setpgrp (0, 0);
+ #endif
}
#endif /* TIOCNOTTY */
#if !defined (RTU) && !defined (UNIPLUS)
/*** There is a suggestion that this ought to be a
Technical Details
Message-ID:
<9005080106.AA01725@elf.TN.Cornell.EDU>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!snorkelwacker!tut.cis.ohio-state.edu!ELF.TN.CORNELL.EDU!eirikShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,c5c7af1286ed6bca,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-05-07 18:06:42 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!snorkelwacker!tut.cis.ohio-state.edu!ELF.TN.CORNELL.EDU!eirik From: eirik@ELF.TN.CORNELL.EDU Newsgroups: gnu.emacs.bug Subject: setpgrp Message-ID: <9005080106.AA01725@elf.TN.Cornell.EDU> Date: 8 May 90 01:06:42 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32 Posted: Tue May 8 02:06:42 1990