Re: RFA: Support Windows extended error numbers in safe_strerror

Christopher Faylor
2006-02-03T23:39:39Z

On Sat, Feb 04, 2006 at 12:25:19AM +0100, Mark Kettenis wrote:
>> Date: Fri, 3 Feb 2006 16:54:55 -0500
>> From: Daniel Jacobowitz <drow@false.org>
>>
>> This is an improved version of a patch Mark Mitchell submitted last
>> year. If you give strerror() anything above 42 (sys_nerr) on Windows,
>> it gives you back "Unknown error" - particularly unfortunate since
>> WSAECONNREFUSED is way above there, so connecting to a closed socket
>> will give you a generic error message. This patch lets us try an
>> OS-specific interface to fetch an error string.
>>
>> [Actually you need my next patch too to get the connection refused message;
>> right now you'll get a timeout.]
>>
>> Any comments on this patch?
>
>I think this is ugly. When the win32 support was added, we were told
>that only minimal changes were necessary. But people keep pushing
>#ifdef EVIL_CLOSED_SOURCE_PLATFORM_FROM_REDMOND patches.
>
>GDB is written for POSIX systems. It's clear that Windows isn't even
>remotely POSIX compliant.

Hmm. As it turns out, I have some email sitting in my "to be sent"
folder that I've held back on sending which is tangentially related
to this.

The gist of the email is that I'm not happy having to support
windows-specific workarounds in gdb while standing on my head in
cygwin-land to make sure that as few workarounds as possible are needed
for programs like gdb.

I'm concerned that the MinGW patches are going to eventually start
encroaching on win32-nat.c (which we've already seen). I don't *want*
to litter that file with any special non-cygwin accommodations.

I feel hypocritical here because I've suggested several times that the
MinGW people should be sending their patches to the gdb list but now
that that day is here, I find that I have no interest in worrying about
windows-native issues at all.

So, my email suggested that if MinGW is important to gdb then I probably
shouldn't be the maintainer for Windows. I do understand why people like
Codesourcery want a native version of gdb. That doesn't mean that I
have to happily support it, though.

So, I'm not sure what to do here. I agree with Mark, though (and with
Ulrich Drepper when he made points about non-POSIX systems in his blog).

cgf