Using cd command with fork in c
问题 Is it possible to change around directories using the fork command? Without going too much into my code I have the following: childpid = fork(); if (childpid >= 0) { if (childpid == 0) { ret = execvp(argv[0],argv); exit(ret); } else { waitpid(childpid,&status,0); ret = WEXITSTATUS(status); } } The above works fine when I'm entering basic command like ls , pwd , etc.. Is it possible to implement a way to use the cd function? I can type the command cd .. but it doesn't do anything. For example