Re: Conceptual question on writeable file descriptors



On Nov 26, 11:33 am, K-mart Cashier <cdal...@xxxxxxxxx> wrote:
Say program A closes it's write half of the connection and then
Program B, which was communicating ith Program A (via a pipe), then
tries to write to the fd on Program A. Program A would generate
SIGPIPE right?

If Program A generates a SIGPIPE, how can the fd on Program A be ready
for writing? Ie, if program A closes it's write end, then how can it
be ready for writing?

I'm not entirely sure what you're getting at, but...

With respect to select(2) and the like, "ready for writing" is sort of
a misnomer. A more accurate description is that select(2) returns
when a write to the file descriptor would not block. The write could
succeed or fail, but in either case it will do so at once, without
blocking.

Does that answer your question?
.



Relevant Pages

  • Conceptual question on writeable file descriptors
    ... Program B, which was communicating ith Program A (via a pipe), then ... If Program A generates a SIGPIPE, how can the fd on Program A be ready ... be ready for writing? ...
    (comp.unix.programmer)
  • Re: Conceptual question on writeable file descriptors
    ... Program B, which was communicating ith Program A (via a pipe), then ... be ready for writing? ... blocking. ...
    (comp.unix.programmer)
  • Re: Handling errors in standard output statements with openmcl
    ... if I pipe the output into less, and then quit less midway ... Simply set the Lisp process to *ignore* SIGPIPE, ... the pipe is closed. ... In CMUCL, you can do that this way: ...
    (comp.lang.lisp)
  • Why not exit on SIGPIPE
    ... a process trying to write on a pipe whose ... far end is closed, exits. ... In unix terminology, that's because SIGPIPE defaults to exit ... But Tcl sets SIGPIPE to SIG_IGN, ...
    (comp.lang.tcl)
  • Re: pipe channel getting blocked on windows
    ... I don't think a lack of SIGPIPE on Windows is the cause of this problem, ... >>You could kill the hung process or avoid closing the pipe, ... > the child with a SIGPIPE that it should close. ...
    (comp.lang.tcl)