[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

popen2/close leaves defunct process

From: Phil Cummins
Subject: popen2/close leaves defunct process
Date: Wed, 16 Aug 2000 18:16:47 +0900


  I'm using octave 2.0.16 on a Redhat Linux 6.2
system. I use popen2 to open a pipe to a subprocess,
much as is described in the help page for open2:

  [in, out, pid] = popen2 ("sort", "-nr");
  fputs (in, "theseŠÜn");
  fputs (in, "areŠÜn");
  fputs (in, "someŠÜn");
  fputs (in, "stringsŠÜn");
  fclose (in);
  while (isstr (s = fgets (out)))
    fputs (stdout, s);
  fclose (out);

(I verified that I do get the following behavior for the
above example)

However, I notice that this leaves a defunct process
in my process table:

% ps x | grep sort
13608 pts/7    Z      0:00 [sort <defunct>]

which remains there until I quit octave. I plan to use 
popen2 in this way many times during an octave session.
Is there any way to remove this process from the table 
when I'm finished with it? Thanks.

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]