Is there a version of the wait() system call that sets a timeout?
问题 Is there any way to use the wait() system call with a timeout, besides using a busy-waiting or busy-sleeping loop? I've got a parent process that fork s itself and exec 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