title: Is there a version of the wait() system call that sets a timeout?
body: <p>Is there any way to use the <code>wait()</code> system call with a timeout, besides using a busy-waiting or busy-sleeping loop?</p>
  
  <p>I've got a parent process that <code>fork</code>s itself and <code>exec</code>s a child executable. It then waits for the child to finish, grabs its output by whatever means appropriate, and and performs further processing. If the process does not finish within a certain period of time, it assumes that its execution timed out, and does something else. Unfortunately, this timeout detection is necessary given the nature of the problem.</p>