Comment by duped

7 days ago

Yes, this is easy to test too:

    #include <stdio.h>
    #include <unistd.h>
    #include <sys/types.h>
    int main() {
        pid_t pid = fork();
        if (pid == 0) {
            sleep(1);
            printf("after parent died!\n");
            return 0;
        }
        return 0;
    }

You'll see the message printed out 1 second after the process ends.