home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!nic.csu.net!koko.csustan.edu!rat!zeus!kwang
- Newsgroups: comp.unix.programmer
- Subject: SIGNALS
- Message-ID: <1992Aug19.001455.222056@zeus.calpoly.edu>
- From: kwang@zeus.calpoly.edu (Kevin Wang aka The Scarecrow)
- Date: Wed, 19 Aug 1992 00:14:55 GMT
- Organization: The Outland Riders
- Lines: 25
-
- How does one handle multiple signals that happen (almost)
- simultaneously? Currently, the parent process forks off multiple
- times, and each of the children then dies after it's done. Now, if all
- 3-5 children finish almost immediately, the signal handler doesn't
- finish before the next signal comes in. At the very minimum, I need to
- wait() for the child process so that I can get its exit value.
- Currently the handler looks like:
-
- void ChildHandler(void)
- {
- Handle_the_signal();
- signal(SIGCHLD, SIG_IGN); /* the only way I know to 'clear' the signal */
- signal(SIGCHLD, ChildHandler);
- return;
- }
-
- help? inside Handle_the_signal() it has a bit of searching to do, so it's
- taking longer than I'd like it to, but I can't find any other way around it.
-
- - Kevin Wang
- ...And now, for your local station identification, on the hour, every hour...
- kwang@hermes.calpoly.edu or kwang@gauss.elee.calpoly.edu
- ---
- MURPHY'S LAWS OF COMBAT
- 4. There is always a way.
-