Re: O_DIRECT on macOS - Mailing list pgsql-hackers

From Andres Freund
Subject Re: O_DIRECT on macOS
Date
Msg-id 20210713015609.kq3ywdlesrdopdrb@alap3.anarazel.de
Whole thread Raw
In response to Re: O_DIRECT on macOS  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: O_DIRECT on macOS
List pgsql-hackers
Hi,

On 2021-07-13 13:25:50 +1200, Thomas Munro wrote:
> On Mon, May 31, 2021 at 10:29 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > For comparison, here is my sketch of idea #1.  I pick an arbitrary
> > value to use as PG_O_DIRECT (I don't want to define O_DIRECT for fear
> > of breaking other code that might see it and try to pass it into
> > open()... for all I know, it might happen to match OS-internal value
> > O_NASAL_DEMONS), and statically assert that it doesn't collide with
> > standard flags we're using, and I strip it out of the flags I pass in
> > to open().  As I said, a bit icky, but it's a tiny and localised
> > patch, which is nice.
> 
> I'm planning to go with that idea (#1), if there are no objections.

The only other viable approach I see is to completely separate our
internal flag representation from the OS representation and do the whole
mapping inside fd.c - but that seems like a too big hammer right now.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Introduce pg_receivewal gzip compression tests
Next
From: Michael Paquier
Date:
Subject: Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm