So, the program is pretty simple: I'm supposed to call the program ./program file_name
and its supposed to fork 2 children that will open the same file (argv[1] = file_name ). But as far as I can see I'm missing something because the program forks only one child.

try changing the inner loop variable to say 'j' rather than i. What i feel is that your main loop does not get executed twice because the value of 'i' already becomes 2 in your inner loop (of parent process).