[MUD-Dev] Re: lurker emerges
J C Lawrence
claw at under.engr.sgi.com
Wed Sep 16 17:30:39 CEST 1998
On Sun, 9 Aug 1998 23:28:17 -0600
Chris Gray<cg at ami-cg.GraySage.Edmonton.AB.CA> wrote:
> I'm bumping into this right now with my simple MUD client. I call
> out to an external editor for editing stuff, but the client needs
> to stay active while that editing is going on. So, to know when
> the editor process is done, I need to set up a SIGCHLD handler and
> catch the process exit. However, that is a signal, which if I'm
> not careful can cause error reports from 'read's on user input and
> on read/writes to the socket to the server. Ick. Give me true
> asynchronous I/O (like on the Amiga) anyday!
A common approach:
fork a child.
Have the child fork the editor.
Have the child catch the SIGCHILD from the editor.
Have the child send a normal IPC message (pipe, whatever) to the
parent before terminating silently (turn off SIGCHILD).
Have the parent respond to the message whenever it wants.
True, its nasty, ugly, and brutish as well as being inelegant and
resource expensive. It also works.
--
J C Lawrence Internet: claw at null.net
(Contractor) Internet: coder at ibm.net
---------(*) Internet: claw at under.engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...
More information about the mud-dev-archive
mailing list