GNU bug report logs - #17036
Continuation for Emacs: invoking a process on exit?

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Tue, 18 Mar 2014 22:48:01 UTC

Severity: wishlist

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 17036 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17036 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17036: Continuation for Emacs: invoking a process on exit?
Date: Fri, 21 Mar 2014 10:25:54 +0000
[Message part 1 (text/plain, inline)]
On 21 March 2014 10:18, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Fri, 21 Mar 2014 10:09:10 +0000
> > From: Reuben Thomas <rrt <at> sc3d.org>
> > Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, Andreas Schwab <
> schwab <at> linux-m68k.org>,
> >       17036 <at> debbugs.gnu.org
> >
> > > As long as it does what you want, fine.  But please note that this is
> > > not the same as exiting Emacs and starting a new session, because the
> > > original Emacs didn't shut down all the way, and the PID is the same.
> > >
> >
> > I think I'm still being unclear, sorry.
> >
> > I am assuming that all the regular atexit handlers have already been
> > called, and that Emacs is really about to exit. (That is what I mean by
> > saying that kill-emacs has been run.) So, this could be implemented by
> > ensuring that the first atexit handler to be registered on startup
> checks a
> > "kill-emacs-and-exec" flag, and if it is set, does the exec.
>
> Assuming a call to 'exec' is allowed in an atexit handler.  (I don't
> know if it is.)
>

The only restrictions I can find are that a) if an atexit handler calls
_exit, the remaining handlers are not called; b) if the process is
terminated by a signal, the handlers are not called. The only thing you
can't do is call exit() or longjmp(). You can even call "atexit" from an
atexit handler (the new handler is pushed on the front of the remaining
queue).

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.