#include #include #include #include #include int main(void) { pid_t rc = fork(); if (rc < 0) { fprintf(stderr, "fork failed\n"); return 1; } else if (rc == 0) { printf("hello from child\n"); } else { wait(NULL); printf("hello from parent after wait\n"); } return 0; }