From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13810 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix POSIX_FADV_DONTNEED/_NOREUSE on s390x Date: Mon, 18 Feb 2019 16:06:23 +0100 Message-ID: <20190218150623.27864-1-j.neuschaefer@gmx.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="260486"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: musl@lists.openwall.com Original-X-From: musl-return-13826-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 18 16:12:11 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gvkaY-0015ds-PM for gllmg-musl@m.gmane.org; Mon, 18 Feb 2019 16:12:10 +0100 Original-Received: (qmail 11652 invoked by uid 550); 18 Feb 2019 15:12:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3956 invoked from network); 18 Feb 2019 15:06:48 -0000 X-Mailer: git-send-email 2.20.1 X-Provags-ID: V03:K1:Eze51uEMK5us82R7DE+YRtsYM57AlZ7yAuX4a/vb5vHHD+4wyiz RTnN0lI5VEM7IjX2grOzVw0IBalbfOp0w6kSvzdSPvNgiRbOiHokpooe/MTv4XuvWGgRRO1 mC2VaQ5dXn3lCgHPb+joBfaIv2+sEAWGxi8CBzn6ZRsZgetG8MOhNZy1bywJ4WL0+px8d+g mky0/rI+J+eAZS+Xe9WCA== X-UI-Out-Filterresults: notjunk:1;V03:K0:JeSQ448MYAw=:evlWCuwdD5sPoUpladeqir iXoBRqQfLNpufrtgRogkGA+fpiOuuDb++KC3qZiDeVb8k/EGU/Ek8gjNUc7ntSpcceOS98HzU LiAIZ96KuV4W7SvoqxkyXM5MEoa70cx7nSeoetCN5EGTjy9JDh63sUrlESvbF1NBo9qP2tRr7 O8cUuwG1eIzz+izSpE6kPeKR0NwClQr9LzG/stYt1Rp63HdppvPuUv3YPEXamMpTDTizBiqUs oFADTR6XS5Bs1AxiLWpDkgRolW91ynWa6kO6tBRtTpqzC4njR5xGOkq9XaqhcTP8sLvZ115CA etJ22ILYnKz9BmeUkT89MBlaLyI6tzEeVUfu78YD4Sd4kIhbpBtANCSB+kCFUNmuW96Z/ODf9 cyeeRe5Qj2yFY6h0flg56pXwwjGKsM2NyzrSLGKY8CL9EDHA61oDE4vIilFyK5+yOoNKH3fCQ aKU5uk/lEuLgWKAJ2rqDuRsuk35mJyWiCmKpIPHGLJeqwVWzSjAN8Ve9UFKgAiPl0RfVcEHep YkolMnjVms1JKHFDSHlvhUgkx0TLsqmcXobGMIZirkkiLnjNS/AR3rrHtq8IVXvtRYXt7aHC2 4LtdqUMjpsd1gcFEG8GV+TBuaON3mfEf1dXyH5mR7YPGdwByY3lsxmhgycnaBIk0qtefUZTEg S1CgPaXglXrHC9+J55dj9nJ0ArnclutqXrMUPWPMLk+SUWHHh2WFwrQalGjPJ2xqLYu7lVk7z DbvOUyLNjSLGL2qkCrWQg7eJf+MzRVFw2kkoGAr6NUK4s2EZPhqWSR13fqDyszQIYMPglKz7 Xref: news.gmane.org gmane.linux.lib.musl.general:13810 Archived-At: 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 moving their definition to arch/*/bits/fcntl.h. 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/linux/fadvise.h#n10 [2]: https://git.alpinelinux.org/aports/commit/main/strace/APKBUILD?id=91ba657eca2cd8342dfcf6e077cae7cf3f1fc22c --- I'm not completely sure if this is the right solution, or if there is one with less duplication. --- arch/aarch64/bits/fcntl.h | 3 +++ arch/arm/bits/fcntl.h | 3 +++ arch/generic/bits/fcntl.h | 3 +++ arch/m68k/bits/fcntl.h | 3 +++ arch/mips/bits/fcntl.h | 3 +++ arch/mips64/bits/fcntl.h | 3 +++ arch/mipsn32/bits/fcntl.h | 3 +++ arch/powerpc/bits/fcntl.h | 3 +++ arch/powerpc64/bits/fcntl.h | 3 +++ arch/s390x/bits/fcntl.h | 3 +++ arch/x32/bits/fcntl.h | 3 +++ arch/x86_64/bits/fcntl.h | 3 +++ include/fcntl.h | 2 -- 13 files changed, 36 insertions(+), 2 deletions(-) diff --git a/arch/aarch64/bits/fcntl.h b/arch/aarch64/bits/fcntl.h index 92787976..e7c80b29 100644 --- a/arch/aarch64/bits/fcntl.h +++ b/arch/aarch64/bits/fcntl.h @@ -36,3 +36,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/arm/bits/fcntl.h b/arch/arm/bits/fcntl.h index 4cb1753b..204bfbe1 100644 --- a/arch/arm/bits/fcntl.h +++ b/arch/arm/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h index ae233cc0..0c25a535 100644 --- a/arch/generic/bits/fcntl.h +++ b/arch/generic/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/m68k/bits/fcntl.h b/arch/m68k/bits/fcntl.h index f1c8400f..1cbfa1b7 100644 --- a/arch/m68k/bits/fcntl.h +++ b/arch/m68k/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/mips/bits/fcntl.h b/arch/mips/bits/fcntl.h index 9fd8c23e..57bf3479 100644 --- a/arch/mips/bits/fcntl.h +++ b/arch/mips/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/mips64/bits/fcntl.h b/arch/mips64/bits/fcntl.h index 3bcec15e..83845c0c 100644 --- a/arch/mips64/bits/fcntl.h +++ b/arch/mips64/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/mipsn32/bits/fcntl.h b/arch/mipsn32/bits/fcntl.h index 9fd8c23e..57bf3479 100644 --- a/arch/mipsn32/bits/fcntl.h +++ b/arch/mipsn32/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/powerpc/bits/fcntl.h b/arch/powerpc/bits/fcntl.h index c3f875e5..03f6430e 100644 --- a/arch/powerpc/bits/fcntl.h +++ b/arch/powerpc/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/powerpc64/bits/fcntl.h b/arch/powerpc64/bits/fcntl.h index 6f20bac5..61a19647 100644 --- a/arch/powerpc64/bits/fcntl.h +++ b/arch/powerpc64/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 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/arch/x32/bits/fcntl.h b/arch/x32/bits/fcntl.h index 1b88ad39..e0602778 100644 --- a/arch/x32/bits/fcntl.h +++ b/arch/x32/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/arch/x86_64/bits/fcntl.h b/arch/x86_64/bits/fcntl.h index 1b88ad39..e0602778 100644 --- a/arch/x86_64/bits/fcntl.h +++ b/arch/x86_64/bits/fcntl.h @@ -38,3 +38,6 @@ #define F_GETOWN_EX 16 #define F_GETOWNER_UIDS 17 + +#define POSIX_FADV_DONTNEED 4 +#define POSIX_FADV_NOREUSE 5 diff --git a/include/fcntl.h b/include/fcntl.h index 4d91338b..a8808a0c 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -66,8 +66,6 @@ int posix_fallocate(int, off_t, off_t); #define POSIX_FADV_RANDOM 1 #define POSIX_FADV_SEQUENTIAL 2 #define POSIX_FADV_WILLNEED 3 -#define POSIX_FADV_DONTNEED 4 -#define POSIX_FADV_NOREUSE 5 #undef SEEK_SET #undef SEEK_CUR -- 2.20.1