>>>>> "Joacim" == Joacim Persson <[EMAIL PROTECTED]> writes:

Joacim> thus libforms manual may be wrong regarding FIFOs, but to get
Joacim> back to what DECs man page said on select ("not necessarily
Joacim> have data available"), I wonder if that goes for /all/ kinds
Joacim> of file descriptors or if they just meant file descriptors for
Joacim> /sockets/ that are available for an accept()?

To state it again:

  [Digital]  Objects ready for the requested operation are those which the
  operation would not block and not necessarily those which have data avail-
  able for the operation.

Objects can be anything (even streams, although I even less know what
they are).

Joacim> info libc, sections "I/O Overview" and down explains most of
Joacim> the marvels of streams, pipes, and sockets.

On Digital unix? Nevermind, I think I'll look up the doc when I'll
really need it. Currently I do not have enough free time to look at it
seriously...

Joacim> (The bus drivers are on strike in Sweden, so I'm stuck at home
Joacim> and have started working on my "vy"-client again -- a vi-like
Joacim> mode for LyX using lyxserver -- as a pastime)

That's what I'd call a pervert project :)

Joacim> What must have happened is: select triggered on the input pipe
Joacim> file descriptor, but the read() claimed end-of-file (return
Joacim> 0;); i.e. noone at the other end; broken pipe.  So why is
Joacim> select triggering on a broken pipe?

The pipe is not broken, it is just empty... And DU considers that,
since you can read() from this pipe, it can fire select(). 

Joacim> remove the O_NONBLOCK in the open(), add
Joacim> fcntl(fd,F_SETFL,O_NONBLOCK) on the next line (or whatever the
Joacim> fd is named). (no need for a signal handler for SIGPIPE for
Joacim> the reader process, and the "reset connection"-lines can stay
Joacim> too)

I tried it, and LyX just sits there blocked. The relvant lines I tried
are

        infd = open(tmp.c_str(), O_RDONLY);
        fcntl(infd,F_SETFL,O_NONBLOCK);

gdb says that LyX is blocked at the open().

JMarc

Reply via email to