| From: | Magnus Hagander <magnus(at)hagander(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | pgsql-patches(at)postgresql(dot)org |
| Subject: | Re: Fix for win32 stat() problems |
| Date: | 2008-04-09 18:20:29 |
| Message-ID: | 20080409202029.7f196767@mha-laptop |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > + #ifndef WIN32
> > if (stat(xlogpath, &stat_buf) == 0)
> > + #else
> > + if (pgwin32_safestat(xlogpath, &stat_buf) == 0)
> > + #endif
>
> Ick. Please do this the way we normally do things when we have to
> override broken Windows syscalls, that is put something like
>
> #define stat(...) pgwin32_stat(...)
>
> into the win32 port header file, so the calls don't have to be
> nonstandard.
The reason not to do so was to avoid having to do the two filesystem
calls for *every* stat, instead just calling them both when we actually
need to use the st_size member. I take it you don't think that's a good
enough reason, but I just want to be sure you're aware that's why I did
it the way I did.
Or do you by any chance now a better way to accomplish that goal? :-)
//Magnus
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Florian Pflug | 2008-04-09 19:17:09 | Re: [PATCHES] libpq type system 0.9a |
| Previous Message | Tom Lane | 2008-04-09 18:14:46 | Re: Fix for win32 stat() problems |