Skip site navigation (1) Skip section navigation (2)

Re: REPOST: InitDB Failure on install

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>,<pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: REPOST: InitDB Failure on install
Date: 2004-08-23 18:58:15
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE4569D4@algol.sollentuna.se (view raw or flat)
Thread:
Lists: 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 by date

Next:From: Merlin MoncureDate: 2004-08-23 19:48:55
Subject: Re: REPOST: InitDB Failure on install
Previous:From: Tom LaneDate: 2004-08-23 18:20:03
Subject: Re: REPOST: InitDB Failure on install

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group