07-26-2023, 07:08 PM
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 given the nature of the problem.
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 given the nature of the problem.