Re: O_DIRECT on macOS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: O_DIRECT on macOS
Date
Msg-id 234364.1626704007@sss.pgh.pa.us
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
Thomas Munro <thomas.munro@gmail.com> writes:
> On Mon, Jul 19, 2021 at 4:42 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> prairiedog thinks that Assert is too optimistic about whether all
>> those flags exist.

> Fixed.

Hmm ... we used to have to avoid putting #if constructs in the arguments
of macros (such as StaticAssertStmt).  Maybe that's not a thing anymore
with C99, and in any case this whole stanza is fairly platform-specific
so we may not run into a compiler that complains.  But my hindbrain wants
to see this done with separate statements, eg

#if defined(O_CLOEXEC)
    StaticAssertStmt((PG_O_DIRECT & O_CLOEXEC) == 0,
                     "PG_O_DIRECT collides with O_CLOEXEC");
#endif

            regards, tom lane



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: Question about non-blocking mode in libpq
Next
From: Tom Lane
Date:
Subject: Re: Failure with 004_logrotate in prairiedog