Linux errno 32 (EPIPE) — Broken Pipe
Informationalerrno
Overview
Linux errno 32 (EPIPE) means a write was attempted on a pipe or socket whose reading end has been closed.
Key Details
- EPIPE — broken pipe, reader has disconnected
- Also generates SIGPIPE signal (default: terminate process)
- Common in piped commands and network programming
- Handle by ignoring SIGPIPE or checking write return values
Common Causes
- Pipe reader process terminated before writer finished
- Network client disconnected while server was sending data
- Head command only reads partial output then exits
- Socket peer closed the connection
Steps
- 1For scripts: pipe output to head/tail can cause EPIPE (normal)
- 2For programs: ignore SIGPIPE signal with signal(SIGPIPE, SIG_IGN)
- 3Check write() return value for errors
- 4Use MSG_NOSIGNAL flag with send() on sockets
Tags
linuxerrnoerrno 32 epipetroubleshootingfix
More in Errno
linux-errno-1-epermLinux errno 1 (EPERM) — Operation Not Permitted
Warninglinux-errno-2-enoentLinux errno 2 (ENOENT) — No Such File or Directory
Warninglinux-errno-5-eioLinux errno 5 (EIO) — Input/Output Error
Errorlinux-errno-11-eagainLinux errno 11 (EAGAIN) — Resource Temporarily Unavailable
Informationallinux-errno-12-enomemLinux errno 12 (ENOMEM) — Out of Memory
Criticallinux-errno-13-eaccesLinux errno 13 (EACCES) — Permission Denied
WarningFrequently Asked Questions
In piping commands, it is normal (e.g., yes | head). In network code, it means the client disconnected.