No concrete problem reported, but in the past it's been known to cause
problems on some compilers so let's avoid doing that.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/234364.
1626704007%40sss.pgh.pa.us
*/
StaticAssertStmt((PG_O_DIRECT &
(O_APPEND |
-#if defined(O_CLOEXEC)
- O_CLOEXEC |
-#endif
O_CREAT |
-#if defined(O_DSYNC)
- O_DSYNC |
-#endif
O_EXCL |
O_RDWR |
O_RDONLY |
O_TRUNC |
O_WRONLY)) == 0,
"PG_O_DIRECT value collides with standard flag");
+#if defined(O_CLOEXEC)
+ StaticAssertStmt((PG_O_DIRECT & O_CLOEXEC) == 0,
+ "PG_O_DIRECT value collides with O_CLOEXEC");
+#endif
+#if defined(O_DSYNC)
+ StaticAssertStmt((PG_O_DIRECT & O_DSYNC) == 0,
+ "PG_O_DIRECT value collides with O_DSYNC");
+#endif
+
fd = open(fileName, fileFlags & ~PG_O_DIRECT, fileMode);
#else
fd = open(fileName, fileFlags, fileMode);