Send SIGPIPE when writing to a closed pipe/socket
Open
area: filesystem
area: networking
exported
priority: p2
type: cleanup
type: enhancement
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
man 2 write:
"EPIPE fd is connected to a pipe or socket whose reading end is closed. When this happens the writing process will also receive a SIGPIPE signal. (Thus, the write return value is seen only if the program catches, blocks or ignores this signal.)"
As is typical, the man page oversimplifies things. For sockets there are three different behaviors (that I've found so far):
SOCK_STREAM: returns EPIPE and sends SIGPIPE
SOCK_SEQPACKET: returns EPIPE and *does not* send SIGPIPE
SOCK_DGRAM: return ECONNREFUSED and does not send SIGPIPE
Contributor guide
Assessment
This issue has not been assessed yet.