SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] ext_poll problem


Chronological Thread 
  • From: Michael Tuexen <Michael.Tuexen AT micmac.franken.de>
  • To: rcl AT ihug.co.nz
  • Cc: discussion AT sctp.de, Thomas Dreibholz <dreibh AT iem.uni-due.de>
  • Subject: Re: [SCTP-Discussion] ext_poll problem
  • Date: Mon May 22 20:12:19 2006
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi,

poll() is not available on all systems, select is.
Thank is why we build on that system call.

Thomas, can you look at the other issues?

Best regards
Michael

On May 22, 2006, at 1:30 AM,
rcl AT ihug.co.nz
wrote:

Hi,

There is a problem with ext_poll in socketapi-1.7.0.

The use of the getdtablesize() function is incorrect.

E.g., on my system, it is returning 256, which is less than
the fake file descriptor values (around 1024) used by
sctplib. Then of course ext_select ignores the FDs passed
in.

A minimal patch to fix this is below, although I think it
would be preferable to implement ext_poll directly, rather
than going through ext_select.

There are someother minor problems with ext_select and
ext_poll (not fixed in my patch).

1. In ext_select, the logic for filling in the returned
bitmasks appears to be done twice - you clear out the
bitmasks, fill them, clear them out a second time and fill
them in again.

2. The return values from ext_poll and ext_select are not
quite correct.

A successfull call to ext_poll is meant to return the number
of pollfd.revent fields filled in with non-zero values.
Currently it just returns what ext_select returns.

A successfull call to ext_select is meant to return the
total number of bits set in the FDs on return. This does
not appear to be calculated correctly.

3. For the case where the FD sets are empty, the return
value is not correct. You fall back to doing:

select(0,NULL,NULL,NULL,timeout);

but ignore the return value (which may be -1, EINTR).

4. I think the getErrnoResult function used in the
errno_return macro, is not correct in the success case. It
sets errno=0. The Unix logic is to not change errno on
success, I believe.

Cheers,
Ralph.

PS. Is there a cvs (or other version control) of sctplib
and socketapi available?
_______________________________________________
discussion mailing list
discussion AT sctp.de
http://www.sctp.de/mailman/listinfo/discussion






Archive powered by MHonArc 2.6.19+.

Top of page