I'm writing a C program that pipes the output of a first program into the input of a second program. The program needs to terminate with the use of sigaction and SIGKILL if either program takes longer than 3 seconds to reach termination.
My program works on "good" inputs. I'm not sure how to implement it so that it behaves as it should for processes that exceed 3 seconds. This is my first time working with interprocess communication and I'm forced to use sigaction to facilitate it. I'm completely lost with the implementation of this part of the program.
I create two child processes: one for each program. How can I use system calls, sigaction, and SIGKILL to terminate the entire program if one of my child processes takes longer than 3 seconds to terminate?