#include #include #include int main() { pid_t pid; printf("program started\n"); pid = fork(); if (pid < 0) { // error, fork failed printf("fork failed\n"); } else if (pid == 0) { // child process execlp("/bin/ls", "/bin/ls", 0); // overwrite self printf("never executes\n"); } else { // parent process printf("this is the parent\n"); } return 0; }