/* COMP2001/2401 - Winter 2013 execvp: morphs the current program into another program */ #include #include #include int main() { char program[80]; // name program to morph into char *args[3]; // command line arguments of new // program int rc; // we will morph the current process // into program strcpy(program, "./p"); // program will start executing // with input arguments as defined here args[0] = "anything here"; args[1] = "--help"; args[2] = NULL; printf("morph process now...\n"); // morph the process rc = execvp(program, args); // we failed if we get to this line in the code printf("rc = %d \n", rc); }