Reading from stdin by multiple processes
问题 I am writing a program in which the parent process uses fork() to create N child processes (N is provided as an argument), so that every child is directly forked by this one parent. Every child process needs to read a line from stdin , and print on to the screen. After compiling and executing the program, the text is provided through a text file like this: ./prog1 3 < fileWithText.txt My problem is, that I am expecting to see every child "fight" for reading the input, however what I actually