[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: broken pipe



On Mon, 09 Jun 1997 22:49:22 CDT "Tim O'Brien" (tjobrien@Traveller.COM
) wrote:

> Ok, I finally have to break down and ask a potential dumb question: What
> the heck is a 'broken pipe'? I get these from time to time on my Debian box.

Err, first what is a pipe ?
A pipe a channel between two processes: everything that the first process will write (to stdout) will be read (from stdin) (it can also happen for other file descriptors, no always stdin and stdout).
Normally when the first process writing to the pipe has completed, it closes the pipe, and the second process, reading the pipe ends gracefully.
But if the second process terminates while the first is still writing to the pipe, the first process gets a broken pipe signal (SIGPIPE).
Eg:
	phil@ceramic:~% yes | sh -c 'kill $$'
	zsh: 14466 broken pipe  yes | 
	zsh: 14467 terminated   sh -c kill $$
The shell (zsh) reports that the first process died of sigpipe while the second terminated unexpectedly (a SIGTERM actually).

You might want to read:
	pipe(2)
	signal(7)
	A good book about unix.

Phil.




--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: