home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!ftpbox!motsrd!white!glas!glas!hartnett
- From: hartnett@glas.rtsg.mot.com (Ger Hartnett)
- Subject: calling system() with SIGCLD ignored (SysV).
- Message-ID: <1992Sep2.164144.11558@glas.rtsg.mot.com>
- Sender: news@glas.rtsg.mot.com
- Nntp-Posting-Host: glas8
- Organization: Motorola Cellular Infrastructure Div., Cork, Ireland.
- Distribution: comp
- Date: Wed, 2 Sep 1992 17:41:37 GMT
- Lines: 50
-
-
- Hi there,
-
- Apologies if this is a previously discussed topic.
-
- I have a few questions about the interactions between the system() and
- ignoring the SIGCLD signal under SYS V.
-
- I need to spawn off processes and not allow them to become zombie when
- finished. I also need to make calls to the system() function in the
- parent process.
-
- I have set up a simple test program which sets SIGCLD to be ignored,
- forks a child process and then calls system(). The system() call
- hangs in wait(). It does exit with ECHILD when the system call
- finishes but will not do this if other children have been started and
- not yet exited.
-
- I then set up a signal handler for SIGCLD which just calls wait. This
- also ensured the spawned processes do not go zombie but the system()
- function call exits with errno set to EINTR (when the command
- submitted has been executed). Re-submitting the system() call executes
- the complete command again.
-
- I can't spawn off daemons (setpgrp and double fork) as I need the
- spawned processes to stop when the terminal logs out.
-
- So I really haven't found a satisfactory solution. What I really need
- to know is if this is a catch 22 situation. Is there any better way of
- doing what I need to do.
-
- (I am using Tandem NonStop-UX rA21 and UNIX System V/88 Release
- R32V2).
-
- Thanks,
- gerH.
-
- --
- +----------------------------------------------------+
- | Ger Hartnett, |
- | PaperNet: Motorola Ireland Ltd. |
- | Cellular Infrastructure Division |
- _____ __ __| Mahon Industrial Estate |
- / ___/ / /_/ /| Cork, Republic of Ireland. |
- / / _ / __ / | |
- / /_/ // / / / | InterNet: hartnett@glas.rtsg.mot.com |
- /_____//_/ /_/ | UUCP: ...motcid!glas!hartnett |
- | Voice: +353 21 357 101 |
- | FAX: +353 21 357 635 |
- +----------------------------------------------------+
-