Re: pgwin32_open returning EINVAL

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Trevor Talbot <quension(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas ADI SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgwin32_open returning EINVAL
Date: 2007-12-20 16:01:22
Message-ID: 20071220160122.GF26753@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 20, 2007 at 07:57:23AM -0800, Trevor Talbot wrote:
> > I'd expect the compiler to optimize away those, but I'll make it a var
> > anyawy.
>
> It can't; it's an opaque callout to kernel32.dll, and there's nothing
> that tells the optimizer when you can expect to get the same result.
> That said, it's cheaper than it looks, since the error code is stored
> at a fixed location in thread-specific VM space. I guess it wasn't
> interesting enough to make an MSVC intrinsic instead of keeping it a
> system detail.

Interesting. I was certainly it was an intrinsic, but it seems not...
Variable, it is..

//Magnus

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-12-20 16:03:55 Re: duplicate columns with COPY
Previous Message Trevor Talbot 2007-12-20 15:57:23 Re: pgwin32_open returning EINVAL