Learn and use fork(), vfork(), wait() and exec() system calls across Linux Systems

1 Response

  1. Bogus Honcho says:

    I tried your first example in a virtual terminal in Linux Mint 19 XFCE, and it produced an error:

    l_fork.c:3:1: error: unknown type name ‘Int’; did you mean ‘int’?
    Int main(void)
    ^~~
    int

    I corrected the ‘Int’ to ‘int’ and ran it again, and this time it produced a slightly different output to yours:

    Before fork
    after fork
    after fork

    Why does it produce two ‘after fork’ lines?

Leave a Reply

Your email address will not be published. Required fields are marked *