Re: O_DIRECT on macOS
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-07-19T23:23:48Z
Lists: pgsql-hackers
Attachments
- 0001-Support-direct-I-O-on-Solaris.patch (text/x-patch) patch 0001
- 0002-XXX-Test.patch (text/x-patch) patch 0002
On Tue, Jul 20, 2021 at 2:13 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > 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 Ok, done. While I was here again, I couldn't resist trying to extend this to Solaris, since it looked so easy. I don't have access, but I tested on Illumos by undefining O_DIRECT. Thoughts?
Commits
-
Don't use #if inside function-like macro arguments.
- 0c08856856f5 15.0 landed
-
Support direct I/O on macOS.
- 2dbe8905711b 15.0 landed