linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming@vger.kernel.org
Subject: Re: Defunct Processes
Date: Wed, 29 Dec 2004 11:16:58 +0100	[thread overview]
Message-ID: <20041229101658.GR2460@lug-owl.de> (raw)
In-Reply-To: <BDF77D14.1AE7%dsessions@ionosphere.net>

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

On Tue, 2004-12-28 21:13:56 -0500, Darren Sessions <dsessions@ionosphere.net>
wrote in message <BDF77D14.1AE7%dsessions@ionosphere.net>:
> The application I'm working on right now gets called from another
> application. When my program is finished, I just use exit(0); to quit, but
> if I do a ps there are a ton of [applicationname] <defunct> messages.

This is a fault of the calling application. Your program became a
zombie. That's the remaining rest of a process that already finished.
(Basically, it consists of accounting information, the process' exit
value and probably of the signal number that led to the process' death).

This information needs to be handled (the parent process needs to wait()
or wait4() it, or using other methods). Normally, the parent process
should handle the SIGCHLD signal; it's generated upon a child's death.
This would allow the parent to call wait() as long as there are finished
childs (remember, you only know the signal got fired, but you don't know
how often :)  Calling wait() then will finally bury the finished child.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-12-29 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-13 10:04 Assignment make pointers r_zaca
2004-12-13 10:10 ` Jan-Benedict Glaw
2004-12-13 14:51   ` Eric Bambach
2004-12-13 14:58     ` Eric Bambach
2004-12-13 15:01       ` C Newbie Darren Sessions
2004-12-13 15:50         ` Jan-Benedict Glaw
2004-12-13 16:03         ` Eric Bambach
2004-12-29  2:13         ` Defunct Processes Darren Sessions
2004-12-29 10:16           ` Jan-Benedict Glaw [this message]
2004-12-30 13:14             ` Daniel Souza
2004-12-13 15:47     ` Assignment make pointers Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041229101658.GR2460@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).