Penguin
Annotated edit history of SIGPIPE version 7, including all changes. View license author blame.
Rev Author # Line
1 PerryLorier 1 !!!Signal: Pipe
2
3 This signal is raised when a program writes to a socket or fifo that has no readers. The default action of this signal is to cause the program to terminate.
2 JohnMcPherson 4
5 You might see this message if you have a series of commands in a shell pipe line and one of the processes quits. Eg:
6 $ cat somefile | head
3 JohnMcPherson 7 After "head" has printed out the first 10 lines and quits, "cat" will get a pipe error. However, cat catches the signal and quits gracefully. If you pipe the output of some cvs(1) commands into less(1) and quit, then you might see the shell print out a message as cvs doesn't handle this signal gracefully.
5 JohnMcPherson 8
9 Another example, using strace(1) to show system calls:
7 JohnMcPherson 10 <verbatim>
5 JohnMcPherson 11 $ strace ls /etc | echo
12 execve("/bin/ls", [["ls", "/etc"], [[/* 52 vars */]) = 0
13 ...
14 write(1, "a2ps\nadjtime\napache2\napm\nasound."..., 1593) = -1 [EPIPE] (Broken pipe)
15 --- SIGPIPE (Broken pipe) @ 0 (0) ---
16 +++ killed by SIGPIPE +++
17 $
7 JohnMcPherson 18 </verbatim>
4 GrahamBreed 19
6 PerryLorier 20 If you get this message when writing to a socket, it can be avoided by passing [MSG_NOSIGNAL] as a flag to send() or ignoring the signal by using signal(SIGPIPE,SIG_IGN);