That is sourced by calling
wait(2) - Linux manual page[
^] and having an infinite
while
loop in your child process. The
wait()
call will block the parent until the child terminates or stopps / resumes by a signal. But that never happens in your code.
Note also that the unused side of a pipe should be closed and you are sending junk data which are never received (you are sending 100 bytes but receive only 30). Send only the number of bytes that are necessary (string length plus one here) and use a receive buffer that is large enough to hold the max. number of bytes that might be send.
See also
6.2.2 Creating Pipes in C[
^].