mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH v2] fix POSIX_FADV_DONTNEED/_NOREUSE on s390x
@ 2019-02-20 18:07 Jonathan Neuschäfer
  0 siblings, 0 replies; only message in thread
From: Jonathan Neuschäfer @ 2019-02-20 18:07 UTC (permalink / raw)
  To: musl; +Cc: Jonathan Neuschäfer

On s390x, POSIX_FADV_DONTNEED and POSIX_FADV_NOREUSE have different
values than on all other architectures that Linux supports[1].

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

This bug was caught by a build failure in strace[2].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/lin
[2]: https://git.alpinelinux.org/aports/commit/main/strace/APKBUILD?id=91ba657eca2cd8342dfcf6
---
 arch/s390x/bits/fcntl.h | 3 +++
 include/fcntl.h         | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/s390x/bits/fcntl.h b/arch/s390x/bits/fcntl.h
index 1eca6ba5..a231efb4 100644
--- a/arch/s390x/bits/fcntl.h
+++ b/arch/s390x/bits/fcntl.h
@@ -38,3 +38,6 @@
 #define F_GETOWN_EX 16
 
 #define F_GETOWNER_UIDS 17
+
+#define POSIX_FADV_DONTNEED   6
+#define POSIX_FADV_NOREUSE    7
diff --git a/include/fcntl.h b/include/fcntl.h
index 4d91338b..f6c192f5 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -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
-- 
2.20.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-20 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 18:07 [PATCH v2] fix POSIX_FADV_DONTNEED/_NOREUSE on s390x Jonathan Neuschäfer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).