"Eric J. Schwertfeger" <[EMAIL PROTECTED]> writes:

> Due to what appears to be a bug in /bin/sh which was reportedly fixed
> about a month ago, both defines were getting an empty string for their
> value. Balazs posted a fix yesterday, which was to run the expansion,
> assigning the results to a variable, and then use just the variable within
> the redirect.

Hmm. Then I'll say that the configure script is ok. I'll add a line in
the README saying that people can try using bash if the experience
problems. 

> No response from the FreeBSD list on that yet.  Balazs suggested using
> POLLIN|POLLRDNORM.

Ok, I'll do this, although I consider it a kludge. 

> Anyone here have anything remotely resembling online POSIX specs
> covering poll()? By my interpretation of the man page, POLLIN should
> work unless reading from a disk-based file is considered high
> priority, but I can't find anything saying what is supposed to be
> high priority.

High priority usually means out-of-band data on TCP connections
(although I guess it can mean other things on a system with
STREAMS). Regarding disk-i/o as high priority seems absurd. Any way,
my reading of the man page Bazsi posted is that POLLIN and POLLRDNORM
are equivalent:

     POLLIN              Data other than high priority  data  may
                         be  read without blocking.  For STREAMS,
                         this flag is set in revents even if  the
                         message is of zero length.

     POLLRDNORM          Normal data (priority band equals 0) may
                         be  read without blocking.  For STREAMS,
                         this flag is set in revents even if  the
                         message is of zero length.

POLLPRI and POLLRDBAND seems to be equivalent in the same way. I would
guess one of the names exists for backwardscompatibility only.

One other detail that I didn't know is that POLLHUP is orthogonal to
POLLIN:

     POLLHUP             A hangup has  occurred  on  the  stream.
                         This  event  and  POLLOUT  are  mutually
                         exclusive; a stream can never  be  writ-
                         able if a hangup has occurred.  However,
                         this  event  and   POLLIN,   POLLRDNORM,
                         POLLRDBAND,  or POLLPRI are not mutually
                         exclusive.  This flag is only  valid  in
                         the  revents  bitmask; it is not used in
                         the events member.

Probably, lsh doesn't handle this correctly in all cases. What is the
right way to detect EOF when reading? I guess POLLIN will say data is
available, and read() returns zero. At least, that's the way it works
with select().

/Niels

Reply via email to