All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Scondo <michael_scondo@gmx.de>
To: linux-c-programming@vger.kernel.org
Subject: Re: PID's of processes and waiting.
Date: Wed, 23 Jun 2004 17:52:34 +0200	[thread overview]
Message-ID: <200406231752.34807.michael_scondo@gmx.de> (raw)
In-Reply-To: <200406222050.48748.eric@cisu.net>

> 	I am looking for a way to wait for a process to terminate. I have a
> process that was executed via system() and am getting its PID from a file
> it writes itself. I have a few questions.
>

here is how I have implemented somthing similar:

int pid = fork();
if ( pid == 0 )
{ 
exec( the child );
}

int status;
wait( pid, &status, 0 );


Have a look at man wait, the code above is pseudo code. ( There may be 
errors )

Kind regards
Micha


      parent reply	other threads:[~2004-06-23 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23  1:50 PID's of processes and waiting Eric
2004-06-23  3:18 ` Glynn Clements
2004-06-23  3:49   ` Eric
2004-06-23 15:52 ` Michael Scondo [this message]

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=200406231752.34807.michael_scondo@gmx.de \
    --to=michael_scondo@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.