Re: REPOST: InitDB Failure on install

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: REPOST: InitDB Failure on install
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE4569D4@algol.sollentuna.se
обсуждение исходный текст
Список pgsql-hackers-win32
>> What I think we need to do in this case is map the error codes at any
>> "API emulation function" to always return a valid errno
>value, and not a
>> Win32 error code. This can only be done at the actual
>function, since it
>> has to be different depending on situation.
>
>How does Microsoft handle this for their existing Posix-compatibility
>functions?  One would think there is a mapping function somewhere in
>that layer.  Were they polite enough to expose it, by any chance?

No and yes.

They use a function called _dosmaperr().
The function is not publically documented, and it's declared in
"internal.h". It's not exported from the DLL, so it can't be linked
against.

The source is available to VS license holders, but we can't put that in
the backend. But since it's basically a lookup table, we could create
our own (without copying of course!).
They have a big fallback that returns EINVAL. Since the Xenix (by their
comments) error values can't hold more than a very small fraction of the
win32 return codes.

The lookup table is available almost directly copied at
http://cvs.sourceforge.net/viewcvs.py/cvsgui/cvsgui/cvs-1.10/windows-NT/
win32.c?rev=1.1.1.1.12.2.8.2.
But that one is GPL.
(The MS version has some more logic and stuff around it, but the table
is almost the same)

I doubt they'd mind if we 'borrowed' just the lookup table. If that's
acceptable, we can take that table and make our own function. Thoughts?


//Magnus

В списке pgsql-hackers-win32 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: REPOST: InitDB Failure on install
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: REPOST: InitDB Failure on install