when wait() is called by process it blocks calling process until child is done. What happens if calling process have multiple children.
What does wait(NULL) function do. Waits until all children are done?
No. To wait for all children:
If the calling process has SA_NOCLDWAIT set or has SIGCHLD
set to SIG_IGN, and the process has no unwaited children
that were transformed into zombie processes, it will block
until all of its children terminate, and wait() will fail
and set errno to ECHILD.
Having a NULL argument segfaults. Never tried it personally.