emacs-devel
[Top][All Lists]
Advanced

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

Re: Using file descriptors in Emacs


From: Eli Zaretskii
Subject: Re: Using file descriptors in Emacs
Date: Sun, 11 Sep 2016 20:13:29 +0300

> From: address@hidden
> Date: Sun, 11 Sep 2016 12:57:25 -0400
> 
> > To me it sounds most natural.  All of our APIs in this area are like
> > that.
> 
> OK, that works for me. I guess it's not really different from the API I
> would have constructed for file descriptors.
> 
> I can hack up some patches for this. Or maybe people have more thoughts
> on the appropriate API first?

Yes, I'd like to hear other opinions as well.  The above sounds like a
natural extension of what we've been doing in that department, but
that doesn't mean there couldn't be alternative ideas.

> > Btw, running a pipe of processes raises another issue, unrelated to
> > file descriptors: we would need a way to make sure the processes do
> > not start running until all the redirections are set up, otherwise
> > some of them will die with SIGPIPE or somesuch.
> 
> No, SIGPIPE will only happen when the read end of the pipe is no longer
> open anywhere. If a process is writing to a pipe for which the read end
> of the pipe has not yet been passed to a subprocess, that process will
> just block, since we will still have the read end of the pipe open in
> the Emacs process.  We would only close the read end of the pipe after
> forking, and the fork will make a copy of the read end of the pipe so it
> will still be open even while the redirection is in process.

That's not universally true, AFAIK.



reply via email to

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