Thanks.
It's printing the pids as following :

pid: 1355
pid: 0
pid: 0

On the father, it's already reading two lines from the the exec output :

Code:
printf("<<<<%s\n",buffer);
With this printf I'm already obtaining two lines.

The exec output has around 15 lines though, any idea why it's not printing the rest ?