Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: (2) Re: FreeBSD compatability feature request



On Thu, Apr 22, 2004 at 09:09:35AM -0700, Jos Backus wrote:
> On Thu, Apr 22, 2004 at 11:17:19AM +0100, Peter Stephenson wrote:
> > If anybody actually knows anything about all this, their views would be
> > especially welcome.
> 
> Does this help?
> 
>     http://www.cons.org/cracauer/sigint.html
> 
> (Martin Cracauer has been maintaining the FreeBSD /bin/sh on and off.)

That is an informative article.  It includes an interesting section on
"How to be a proper shell".  However, I didn't see any reference to
implementing asynchronous signal traps.  I did find another article
that discusses process waiting and might have helpful information.

http://www.cs.pdx.edu/~jrb/cs303/handouts/on.wait

I also don't have a full understanding of all aspects of signal
handling, but it looks to me like in order to implement trapsasync
mode, it would involve using the WNOHANG option to waitpid() or
wait3() or wait4() to periodically check the child status without
blocking the parent until the child exits.  That way I am guessing you
can immediately receive signals in the parent and kill the child,
exit, or whatever.  My question is, does that affect the child's
ability to be interactive.

I saw a place in the zsh code where WNOHANG was being used in a call
to WAIT() in signals.c:zhandler() but I havn't studied the code well
enough to understand what it is doing or whether that is the relevant
area of code relating to trapsasync.  

-- 
Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
Read how Network Solutions (NSI) was involved in stealing our domain name.
http://www.InetAddresses.net



Messages sorted by: Reverse Date, Date, Thread, Author