in reply to How do you get PID of a program called using system call?

Invoking system() 4 times in a row won't give you 4 simultaneous processes unless whatever you're invoking does a fork(). Even then, you won't easily be able to get a pid unless somebody is kind enough to save it for you.

Your best bet might be to roll the fork()/exec() yourself, so that the parent process can get the child pid directly from fork().