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
execvp does not create a new process. It replaces the current process.
Proper sequence of events would be:
fork() to copy current process. The new process will be identical to the old one with one differnce -- the child and parent get different return values from fork().
Close and/or rearrange file descriptors as you please in the child code to make whatever the stdin/stdout/stderr/etc.
Call execvp in the child process
Maybye you're using fork already, but that code snippet doesn't show it..