fix POSIX_FADV_DONTNEED/_NOREUSE on s390x
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 20 Feb 2019 18:07:12 +0000 (19:07 +0100)
committerRich Felker <dalias@aerifal.cx>
Wed, 13 Mar 2019 15:37:29 +0000 (11:37 -0400)
On s390x, POSIX_FADV_DONTNEED and POSIX_FADV_NOREUSE have different
values than on all other architectures that Linux supports.

Handle this difference by wrapping their definitions in
include/fcntl.h in #ifdef, so that arch/s390x/bits/fcntl.h can
override them.

arch/s390x/bits/fcntl.h
include/fcntl.h

index 1eca6ba5c754b1c7c1718810149d72c0b8ebf6a7..a231efb4a5766eaf5665e6eced17589e68254964 100644 (file)
@@ -38,3 +38,6 @@
 #define F_GETOWN_EX 16
 
 #define F_GETOWNER_UIDS 17
+
+#define POSIX_FADV_DONTNEED   6
+#define POSIX_FADV_NOREUSE    7
index 4d91338b3deba517f7195ecf24f89b57334237c8..f6c192f52ed52cbfc8d010b1847a0155fcf643bb 100644 (file)
@@ -66,8 +66,10 @@ int posix_fallocate(int, off_t, off_t);
 #define POSIX_FADV_RANDOM     1
 #define POSIX_FADV_SEQUENTIAL 2
 #define POSIX_FADV_WILLNEED   3
+#ifndef POSIX_FADV_DONTNEED
 #define POSIX_FADV_DONTNEED   4
 #define POSIX_FADV_NOREUSE    5
+#endif
 
 #undef SEEK_SET
 #undef SEEK_CUR