#include #include #include #include int main(int argc, char ** argv) { int childstat; printf("Entry\n"); pid_t pidreturn = fork(); if (pidreturn == 0) { printf("hello from child\n"); } else { printf("hello from parent. Child's pid is %d\n", pidreturn); /* waitpid(pidreturn, &childstat, 0); assert(WIFEXITED(childstat)); printf("Child exit status: %d\n", WEXITSTATUS(childstat)); //*/ sleep(5); } printf("After conditional\n"); if (pidreturn == 0) { return 1; } else { return 5; } }