Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
SIGPIPE
Edit
PageHistory
Diff
Info
LikePages
!!!Signal: Pipe 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. You might see this message if you have a series of commands in a shell pipe line and one of the processes quits. Eg: $ cat somefile | head 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. Another example, using strace(1) to show system calls: <verbatim> $ strace ls /etc | echo execve("/bin/ls", [["ls", "/etc"], [[/* 52 vars */]) = 0 ... write(1, "a2ps\nadjtime\napache2\napm\nasound."..., 1593) = -1 [EPIPE] (Broken pipe) --- SIGPIPE (Broken pipe) @ 0 (0) --- +++ killed by SIGPIPE +++ $ </verbatim> 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);
9 pages link to
SIGPIPE
:
socket(2)
recvfrom(2)
recvmsg(2)
MSG_NOSIGNAL
sendmsg(2)
Signal
recv(2)
EPIPE
send(2)