spawn(),exec(): child pid

Hi All,

I want to create a child process that would start ‘solitaire’(or any other game).
I want the pid of this game process.

How do I use spawnvp() in this context as spawn*() returns the pid of the process??

I tried the following:

char *const parmList[] ={"sh", "-c", "/usr/photon/bin/solitaire", NULL}; ............ pid_t pid = 0; pid = spawnvp(P_NOWAIT, "sh",parmList);

But the problem here is the return of ‘pid’ is the pid of the /bin/sh and not solitaire.

How do I change this?

Or is there any other way??

Thanks in advance

then why do you start sh and not solitaire directly?