SCTP Discussions

Text archives Help


[SCTP-Discussion] ext_poll problem


Chronological Thread 
  • From: rcl AT ihug.co.nz
  • To: discussion AT sctp.de
  • Subject: [SCTP-Discussion] ext_poll problem
  • Date: Mon May 22 19:42:59 2006
  • List-id: SCTP Discussions <discussion.sctp.de>
  • Priority: normal

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?




Archive powered by MHonArc 2.6.19+.

Top of page