
21 Aug
2010
21 Aug
'10
2:22 a.m.
Quoth Erik de Castro Lopo
The code below *almost* works. Its currently printing out:
parent : Forked child was here! parent : Message from parent. Read 21 bytes
while I think it should print:
parent : Forked child was here! parent : Read 21 bytes
Any clues on why 'Message from parent.' is also ending up on stdout? This is ghc-6.12.1 on Debian Linux.
My guess is that the default tty attributes include ECHO. So the data you write to the master fd is echoed back, as though by the fork process but actually by the terminal driver. You can turn ECHO off. Donn Cave, donn@avvanta.com