#include #include extern char **environ; // simple example of program replacing itself with exec int main(void) { printf("In exec.c %d\n", getpid()); printf("In exec.c parent is %d.\n", getppid()); char *argv[] = {"./process_example", NULL}; execve("./process_example", argv, environ); // if we get here there has been an error perror("execve"); return 1; }