I've created a c program and compiled it with gcc, in unix.
The file name is abc.c and it is run by typing the command ./abc
I have another program which creates a child process, and I need this abc program to run on that child process. I've tried execvp(), but it doesn't work.
#define PNAME "/fullpath/to/abc"
#define ARGS NULL
...
int status;.
if ( (child = fork()) == 0) {
execl(PNAME,basename(PNAME),ARGS);
} else {
waitpid(child,&status,0);
/*test for exit status of child process here with the WIF macros if important*/
}