Xref: utzoo comp.emacs:9786 gnu.emacs.help:654 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!rpi!uupsi!psivax!ttidca!mb From: mb@ttidca.TTI.COM (Michael Bloom) Newsgroups: comp.emacs,gnu.emacs.help Subject: Re: emacs under ksh job control (^z) (SCO Unix 3.2.2) Summary: use setpgid(int pid, int pgrp), not setpgrp(void) on POSIX systems. Keywords: SCO, POSIX, setpgrp, setpgid, twilight zone Message-ID: <22123@ttidca.TTI.COM> Date: 25 Dec 90 05:55:46 GMT References: <1473@beaudin.UUCP> Followup-To: gnu.emacs.help Organization: Citicorp/TTI, Santa Monica Lines: 34 In article <1473@beaudin.UUCP> john@beaudin.UUCP (John Beaudin) writes: I've been using emacs for several months. It works as advertized for my purposes. Recently, I started using the korn shell (ksh) full-time. My previous shell didn't have job control. I decided to re-compile emacs with job control defined. However, when in emacs, when I type ^z, I get my ksh prompt and the shell acts normal, but when I 'fg' I get stuck in some kind of twilight zone Your problem may be similar to (or the same as) one experienced in gdb by one of the people using my "stabs-in-coff" stuff on an SCO system. Certainly your symptoms sound similar. SCO uses the POSIX definitions of some of the facilities used for job control, rather than the BSD definitions. The particular calls of interest are the bsd routines setpgrp() and getpgrp(). SCO's setpgrp() is a superset of the System V routine of the same name, and is probably implemented using the same (or nearly the same) code as the POSIX setsid() routine. Fortunately, posix does define a routine with the semantics you need. It's called setpgid(), and behaves like the bsd setpgrp(). Similarly, the posix routine getpgid() routine behaves like the bsd getpgrp(). I suspect that the fix for the problem you are having on SCO (and probably any other POSIX system) is to add this to your config file: /* use setpgid(int pid, int pgrp), not setpgrp(void) on POSIX systems. */ #define setpgrp setpgid #define getpgrp getpgid