In your parent's main loop, you then know not to exit until %pids is empty.
Yes, I already have %pid, but "until %pids is empty." means either "sleep()" call or 100% cpu "while(1)" loop. Something like usleep(10_000) while(%pids) will work.
But this would be just workaround over non-working wait() call.