[Mono-dev] [HaikuPorts-devs] [RFC 09/12] console-unix: Workaround FIONREAD ioctl for Haiku

Andreas Färber andreas.faerber at web.de
Fri Mar 26 12:02:05 EDT 2010


Hi,

Am 26.03.2010 um 15:39 schrieb François Revol:

> Le Fri, 26 Mar 2010 14:30:02 +0100, Andreas Färber a écrit :
>> This commit is licensed under the MIT X11 license.
>> ---
>> mono/metadata/console-unix.c |    4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-
>> unix.c
>> index 7280b6f..324c0c1 100644
>> --- a/mono/metadata/console-unix.c
>> +++ b/mono/metadata/console-unix.c
>> @@ -159,10 +159,14 @@
>> ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
>> 	} while (ret == -1 && errno == EINTR);
>>
>> 	if (ret > 0) {
>> +#ifdef __HAIKU__
>> +		ret = 0;
>> +#else
>> 		nbytes = 0;
>> 		ret = ioctl (STDIN_FILENO, FIONREAD, &nbytes);
>> 		if (ret >= 0)
>> 			ret = nbytes;
>> +#endif
>> 	}
>>
>
> Don't we have this implemented ?
> If not it should be fixed in the tty driver...

A quick grep -r shows FIONREAD in sys/ioctl.h (and STDIN_FILENO in  
unistd.h).
`hg blame` indicates changeset 17441 or SVN r18456 but also shows "/*  
These only work on sockets for now */". :)

I'll check compilation without this patch next week.

Thanks,
Andreas


More information about the Mono-devel-list mailing list