[MLton-devel] Re: OS.IO.poll portability
Stephen Weeks
sweeks@sweeks.com
Fri, 6 Jun 2003 13:20:19 -0700
> I'm seeing some differences in behavior between SML/NJ 110.42 and
> MLton. Specifically, When I set up a read poll on a passive socket,
> the OS.IO.poll call in MLton always returns that the socket is
> ready. SML/NJ does not; it only returns that the socket is ready if
> there is a pending connection to the socket.
>
> To me, this looks like a bug in MLton (v 20030312),
It is a bug in MLton. We have checked in a fix, and it will appear in
our next release.
If you're up to recompiling the runtime, there is a one character
change to runtime/basis/OS/IO/poll.c that will fix the problem.
------------------------------------------------------------
diff -u -r1.3 -r1.4
--- poll.c 6 Jun 2003 13:40:55 -0000 1.3
+++ poll.c 6 Jun 2003 20:12:57 -0000 1.4
@@ -12,7 +12,7 @@
}
res = poll(ufds, n, timeout);
for (i = 0; i < n; i++) {
- reventss[i] = ufds[i].events;
+ reventss[i] = ufds[i].revents;
}
return res;
}
------------------------------------------------------------
Otherwise, let us (MLton@mlton.org) know and we'll package up an
experimental release.
-------------------------------------------------------
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