c/unix q

c/unix q

Shachar Shemesh shachar at shemesh.biz
Tue Jun 4 18:09:50 IDT 2013


On 04/06/13 15:28, Erez D wrote:
> thanks,
>
> so i guess if i use unidirectional connection, and the reader does not
> expect to get an EOF()
> thank i'm safe.
>
Why are you so keen on doing it wrong?

No, you are not safe. If the child process dies because of a
segmentation fault (or whatever), the parent will notice this through
the EOF received (I am assuming here, since you couldn't be bothered
with closing a file descriptor, that you did not install a SIGCHLD
handler to monitor for this possibility). This means that should one
process die unexpectedly, the other will hang forever.

Best practices are there for a reason, despite what others here might
have you think.

Shachar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20130604/4535c911/attachment.html>


More information about the Linux-il mailing list