[MLton-devel] OS.IO.poll portability

Stephen Weeks MLton@mlton.org
Fri, 6 Jun 2003 12:55:37 -0700


> I  am  completely confused about this.  Isn't it clear that the list returned
> by OS.IO.poll should be empty.  The socket hasn't been connected to and so an
> input (i.e., an accept) would block.  This seems to be what I get with an old
> SML/NJ (110.9.1).  I wrote some C code testing out poll() on Linux 2.4.2  and
> it  seems to also work this way.

On my machine, here's what I see when I strace the example program I
sent earlier.

poll([{fd=3, events=POLLIN}], 1, 5000)  = 0

Since this has no revents, it looks like the list should be empty.
But it isn't.

Hmm.  Maybe there is a bug in runtime/basis/OS/IO/poll.c?  I see that
line 15 reads

		reventss[i] = ufds[i].events;

Maybe it should read

		reventss[i] = ufds[i].revents;



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel