linux.h 1.0 KB

12345678910111213141516171819202122
  1. /* src/include/port/linux.h */
  2. /*
  3. * As of July 2007, all known versions of the Linux kernel will sometimes
  4. * return EIDRM for a shmctl() operation when EINVAL is correct (it happens
  5. * when the low-order 15 bits of the supplied shm ID match the slot number
  6. * assigned to a newer shmem segment). We deal with this by assuming that
  7. * EIDRM means EINVAL in PGSharedMemoryIsInUse(). This is reasonably safe
  8. * since in fact Linux has no excuse for ever returning EIDRM; it doesn't
  9. * track removed segments in a way that would allow distinguishing them from
  10. * private ones. But someday that code might get upgraded, and we'd have
  11. * to have a kernel version test here.
  12. */
  13. #define HAVE_LINUX_EIDRM_BUG
  14. /*
  15. * Set the default wal_sync_method to fdatasync. With recent Linux versions,
  16. * xlogdefs.h's normal rules will prefer open_datasync, which (a) doesn't
  17. * perform better and (b) causes outright failures on ext4 data=journal
  18. * filesystems, because those don't support O_DIRECT.
  19. */
  20. #define PLATFORM_DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC