From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d66c9f9cb6b86f72 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: fork; execve --> defunct process. Date: 2000/01/18 Message-ID: <38843392.FBEA70CB@mail.com>#1/1 X-Deja-AN: 574151214 Content-Transfer-Encoding: 7bit References: <388414AD.E4D4C00D@mail.utexas.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 948188055 17233 195.141.231.162 (18 Jan 2000 09:34:15 GMT) Organization: sunrise communications ag Mime-Version: 1.0 NNTP-Posting-Date: 18 Jan 2000 09:34:15 GMT Newsgroups: comp.lang.ada Date: 2000-01-18T09:34:15+00:00 List-Id: "Bobby D. Bryant" wrote: > > I am trying to get a program to start a second job. I import fork() and > execve() from C, and the calls apparently work OK (i.e., the fork > returns a legitimate PID, and the execve returns a non-negative status). execve never returns if it succeeds. What are you doing between fork and execve in the child ? > However, the child process immediately(?) goes into "defunct" status. > For example, if I try to run the testgtk program, the program's GUI > never pops up, and a ps x shows: defunct means that the process is finished, but its parent does not know yet. To avoid defunct processes, you must do a waitpid for the child in the parent.