[Mono-list] Problems with reads being non-blocking in Mono?

Juli Mallett jmallett@FreeBSD.ORG
Thu, 12 Dec 2002 18:42:34 -0800


Hey,

One way or another it seems like on FreeBSD Mono sets STDIN_FILENO to be
non-blocking, and so Console.ReadLine() fails, since EAGAIN isn't handled,
and the following program simply blows up:

%%%
(jmallett@luna:~/Work/Jwpl#)286% mcs test.cs
Compilation succeeded
(jmallett@luna:~/Work/Jwpl#)287% mono test.exe

Unhandled Exception: System.IO.IOException: I/O Error
in <0x0007a> 00 System.IO.FileStream:ReadData (intptr,byte[],int,int)
in <0x000f2> 00 System.IO.FileStream:Read (byte[],int,int)
in <0x00127> 00 System.IO.StreamReader:ReadBuffer ()
in <0x00088> 00 System.IO.StreamReader:Read ()
in <0x00049> 00 System.IO.StreamReader:ReadLine ()
in <0x00018> 00 .X:Main ()

(jmallett@luna:~/Work/Jwpl#)288% cat test.cs
using System; class X { public static void Main() { Console.ReadLine(); } }
%%%

This doesn't happen on GNU/Linux or with Mono 0.13 on FreeBSD, afaict.

Thanx,
juli.
-- 
Juli Mallett <jmallett@FreeBSD.org>
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.