in reply to Sharing STDIN after fork
The STDIN filehandle is shared between your two processes, and as you already noticed, whatever process comes first reads it all.
You could set a flag to specify, which process should read STDIN, or you could read all of STDIN and then call fork().
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sharing STDIN after fork
by Bod (Parson) on Feb 13, 2022 at 22:27 UTC | |
by Corion (Patriarch) on Feb 14, 2022 at 06:41 UTC |