[Top][All Lists]

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

Re: error in pipe implementation?

From: Gordon Matzigkeit
Subject: Re: error in pipe implementation?
Date: 20 Jul 2001 13:12:44 -0600
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

>>>>> Fabian Sturm writes:

 FS> No sorry you misunderstood me. We dont get a SIGPIPE on read.  We
 FS> get a SIGPIPE on write. That would be okay if we write to a pipe
 FS> without an open read end. But we write to the "read file
 FS> deskriptor" (the wrong end of the pipe) fd[0] and this should
 FS> return a EBADF or something similar.

I think you may be getting bitten by the fact that on the Hurd, all
pipes are bidirectional.  From libc/sysdeps/mach/hurd/pipe.c:

/* Create a one-way communication channel (pipe).
   Actually the channel is two-way on the Hurd.
   If successful, two file descriptors are stored in FDS;
   bytes written on FDS[1] can be read from FDS[0].
   Returns 0 if successful, -1 if not.  */
__pipe (int fds[2])

Why not fix the program so that it does not write to that end of the
pipe in the first place?

 Gordon Matzigkeit <gord@fig.org>  //\ I'm a FIG (http://fig.org/)
Committed to freedom and diversity \//  Run Bash (http://fig.org/gnu/bash/)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]