Hello So I'm on a solaris box and am writing a program that uses fork and is causing defunct processes to spawn. The program has to spawn a SAS process which does funny things to the terminal and so SAS is initiated in the parent process as opposed to the child ( which I think is what most people would expect. ) Anyways the child waits for the parent process to end and then does some logging of its own, while it's waiting it is just sleep(10). When the whole process, both child & parent, are finished the defunct process goes away. I know having the parent process wait for the child is a way to prevent defunct processes, would that make sense in this context however? Is there another way to make the child process non-defunct, at least so that it looks better on the ps - ptree table? Thanks!

In reply to Fork Causing <defunct> by owen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.