Launch execlp as backgroud process

Monday, July 7, 2014

I'm trying to launch a program using execlp, continue with the program. and get control of the shell back.


this is what I did after some research from SO.



pid_t child;
pid_t sid;
child = fork();
if(!child){
sid = setsid();
if(!sid){
exit(1);
}
execlp(RUN_EXE, RUN_EXE, SPEC_RUN.run_args[j], (char *)0);
}


But I'm unable to print anything after execlp. The execlp works correctly for me.


What do I need to do for the shell to return back.







http://ift.tt/1rG77Ny