Re: stat() on Windows might cause error if target file is largerthan 4GB - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: stat() on Windows might cause error if target file is largerthan 4GB
Date
Msg-id 20180913040501.GH3578@paquier.xyz
Whole thread Raw
In response to Re: stat() on Windows might cause error if target file is larger than 4GB  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: stat() on Windows might cause error if target file is larger than 4GB  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Sep 12, 2018 at 08:17:05PM -0400, Tom Lane wrote:
> Yeah, I was afraid of that.  We could invent a typedef "pg_struct_stat"
> that maps to the right thing, but using that everywhere would be a mighty
> invasive change :-(.

There are 130 places where "struct stat " is used, so I'd rather avoid
that.

> And we can't just "#define stat __stat64" because
> that would break the calls to stat().  Or wait, maybe we could do that
> and also have a one-liner function named __stat64 that would catch the
> calls and redirect to _stat64?

I don't think I grab your point here.  "#define stat __stat64" cannot
exist from the start so how would you do that?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Cutting initdb's runtime (Perl question embedded)
Next
From: Amit Langote
Date:
Subject: Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT