[Mono-bugs] [Bug 384227] On Mac OS X, System.IO.Ports. SerialPort cannot read data using any Read* method.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 14 20:55:48 EDT 2008


User Herman at DevSquad.nl added comment

Herman Eldering <Herman at DevSquad.nl> changed:

           What    |Removed                                         |Added
                 CC|                                                |Herman at DevSquad.nl

--- Comment #3 from Herman Eldering <Herman at DevSquad.nl>  2008-10-14 18:55:48 MDT ---
This bug has been reproduced on Mac OS 10.5.5 and with version 2.0 of mono. I
have used a device with the Silabs cp2102 chip and using a Prolific chip (used
by several brands of usb->serial cables).

I have determined that the call to poll() is the source of the problem.
Probably because the poll is broken in Mac OS as confirmed here by an Apple
employee: http://curl.haxx.se/mail/lib-2005-05/0122.html

On the page http://developer.apple.com/technotes/tn2002/tn2071.html Apple
suggests using a fake poll() routine based on select(). I have used the fake
poll that is linked there to solve the problem. To make it work on Suse Linux
(the VM Ware image with Mono 2.0) I have made a change to use
sysconf(_SC_OPEN_MAX) instead of OPEN_MAX.

I have tested this solution with the cp2102 and Prolific on the mac and with
the Prolific chip on linux and confirmed that they behave as expected. I have
not tested this on Windows as they seem to use different methods of accessing
the serial port.

To apply this fix remove the line "#include <sys/poll.h>" from
/support/serial.c and insert the line "#include <fakepoll.h>" below the include
of errno.h. Then put the fakepoll.h that is attached to this bug in the support

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list