Hi ,
I m actually trying to implement pipes program,but after executing the execvp(),my program is getting hanged up
Actaully i m getting the desired output expected from execvp()...but once results are displayed on the output screen ,program is getting hanged up
values of variables before execution of this code
intial_command=more
argList[0]=more
argList[1]=NULL
child code:
{
close(0);
dup2(pipes[0][1],0);
close(pipes[0][0]);
execvp(intial_command,argList);
}
parent code:
printf("after child");
waitpid(pid,&status,0);
i guess since i have closed the stdin using close(0) thats y i m not able to input anythng even after execvp()...but as far my knowledge once the execvp() functions gets executed the child process gets terminated..so my program should resume to parent process