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