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: (view raw, whole thread or download thread mbox)
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

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
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?


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-2017 The PostgreSQL Global Development Group