🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189657

Re: emacs under ksh job control (^z) (SCO Unix 3.2.2)

#189657
From: Sean Eric Fagan
Date: Fri, 28 Dec 1990 03:55
38 lines
2479 bytes
In article <22123@ttidca.TTI.COM> mb@ttidca.TTI.COM (Michael Bloom) writes:
>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.

I believe that *is* the problem.

>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.

Nearly the same; I don't believe that setpgrp() gives the process a new SID,
but it does do lots of nasty things.

>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

Some other 'gotchas' you'll want to deal with:  you should make emacs use
struct termios instead of struct termio; you should make it use XC* instead
of TC* in most cases (check <sys/termio.h> and see which TC* have an XC*
defined); and you should also make it do a setsid() in its children.  That
is, after it's forked, and when it calls setpgid() (setpgrp() if you don't
change the code), make it call setsid() instead.  This will allow things
like shell mode to work (although, please rease comp.std.unix for some
problems with this).

I no longer have source code for the version of emacs I'm using, or else I'd
give you more details.  Sorry.

-- 
Sean Eric Fagan  | "I made the universe, but please don't blame me for it;
sef@kithrup.COM  |  I had a bellyache at the time."
-----------------+           -- The Turtle (Stephen King, _It_)
Any opinions expressed are my own, and generally unpopular with others.
Technical Details
Message-ID: <1990Dec28.035544.28472@kithrup.COM>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!olivea!orc!inews!iwarp.intel.com!csun!kithrup!sef
References: <1473@beaudin.UUCP> <22123@ttidca.TTI.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,cf6f3b97ab23834d
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1990-12-27 21:48:06 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!olivea!orc!inews!iwarp.intel.com!csun!kithrup!sef
From: sef@kithrup.COM (Sean Eric Fagan)
Newsgroups: gnu.emacs.help
Subject: Re: emacs under ksh job control (^z) (SCO Unix 3.2.2)
Keywords: SCO, POSIX, setpgrp, setpgid, twilight zone
Message-ID: <1990Dec28.035544.28472@kithrup.COM>
Date: 28 Dec 90 03:55:44 GMT
References: <1473@beaudin.UUCP> <22123@ttidca.TTI.COM>
Organization: Kithrup Enterprises, Ltd.
Lines: 38