I'm new to Linux, sorry if my question is a little bit basic.
I know the waitpid function is used to wait for state changes in a child of the calling process. So the purpose of the function is to let the parent process stop until a child process terminates.
so it seems like the waitpid function just make sure child processes finishes/terminates first, then the parent process can reap them automatically.
If my understanding is correct, there could be chances that a parent process can still reap its child processes without the need of waitpid function, as child processes might terminate before its parent process by chance.
Is my understanding correct?