Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • POSIX leaves it unspecified what write(1, "", 0) does on a pipe and on Linux, I find it doesn't do anything even on a broken pipe. Commented Feb 24, 2023 at 18:35
  • @StéphaneChazelas, yeh, the man page I was reading says "If all file descriptors referring to the read end of a pipe have been closed, then a write(2) will cause a SIGPIPE signal to be generated for the calling process." though I'm not surprised a zero-byte write would be different. But as mentioned, it doesn't matter here. Commented Feb 25, 2023 at 10:01