help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: Expose system `exec` as a built-in elisp function


From: Andrew Pennebaker
Subject: Re: Feature request: Expose system `exec` as a built-in elisp function
Date: Wed, 13 Aug 2014 13:48:44 -0500

One example of the worthiness of exec is cask, an Emacs package manager
that sometimes wants to fork out to an emacs instance, for editing text
files.


On Wed, Aug 13, 2014 at 1:45 PM, Emanuel Berg <address@hidden>
wrote:

> Andrew Pennebaker <address@hidden> writes:
>
> > That's what I thought, at first. exec has the
> > additional semantic that it replaces the current
> > process with the system call, so it's more efficient
> > for certain tasks.
>
> Yes, exec (man "exec") does this. It accepts an
> argument for what program to execute, and then a list
> of arguments (the argv) to be inputed that program.
>
> It is usually used with fork. One process devides itself
> with fork(), which returns twice (magic!), and from the
> return values the child process can be identified;
> then, the child uses exec to fill itself with software
> so it can do something productive.
>
> So as for this method and setting (which may be
> different from yours) it is not a matter of efficiency,
> it is rather that without exec, often there isn't
> anything for the child to do. (You probably already
> know all this.)
>
> So if you want to replace the current process, can't
> you just have the current process execute whatever code
> you had in mind for exec?
>
> --
> underground experts united
>



-- 
Cheers,

Andrew Pennebaker
www.yellosoft.us


reply via email to

[Prev in Thread] Current Thread [Next in Thread]