i want to get the status of child process (when execvp is failed) in the father process so im useing the next code: (im programming on linux)
but the value of status is stay a junk number.Code:pid=fork(); if(pid==0) { if(execvp(com[0],com)==-1) exit(-1); } else { waitpid(pid,&status,0); }
can someone help me in this problem ?
thanks !