diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 628d27f..cb3b6aa 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -17,6 +17,8 @@
License along with the GNU C Library. If not, see
. */
+#define __ASSUME_READAHEAD_ALIGN 1
+
#include_next
/* The ARM kernel before 3.14.3 may or may not support
diff --git a/sysdeps/unix/sysv/linux/arm/readahead.c b/sysdeps/unix/sysv/linux/arm/readahead.c
deleted file mode 100644
index 9824e6f..0000000
--- a/sysdeps/unix/sysv/linux/arm/readahead.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Provide kernel hint to read ahead.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- . */
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-
-ssize_t
-__readahead (int fd, off64_t offset, size_t count)
-{
- return INLINE_SYSCALL (readahead, 5, fd, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)),
- count);
-}
-
-weak_alias (__readahead, readahead)
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 71ce57a..24216e5 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -50,6 +50,11 @@
#define __ASSUME_ST_INO_64_BIT 1
#endif
+#ifndef __ASSUME_READAHEAD_ALIGN
+/* readahead() adds padding to registers if this control is enabled. */
+# define __ASSUME_READAHEAD_ALIGN 0
+#endif
+
/* The statfs64 syscalls are available in 2.5.74 (but not for alpha). */
#define __ASSUME_STATFS64 1
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index b486d90..88f4f5e 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -31,6 +31,7 @@
/* Define this if your 32-bit syscall API requires 64-bit register
pairs to start with an even-number register. */
#if _MIPS_SIM == _ABIO32
+# define __ASSUME_READAHEAD_ALIGN 1
# define __ASSUME_ALIGNED_REGISTER_PAIRS 1
#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/readahead.c b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
deleted file mode 100644
index 80170c3..0000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
+++ /dev/null
@@ -1 +0,0 @@
-#include
diff --git a/sysdeps/unix/sysv/linux/readahead.c b/sysdeps/unix/sysv/linux/readahead.c
index 92e5428..d31bd6e 100644
--- a/sysdeps/unix/sysv/linux/readahead.c
+++ b/sysdeps/unix/sysv/linux/readahead.c
@@ -23,13 +23,22 @@
#include
#include
+#include
#ifdef __NR_readahead
+#if __ASSUME_READAHEAD_ALIGN
+# define __READAHEAD_ARGS 5
+# define __READAHEAD_ALIGN 0,
+#else
+# define __READAHEAD_ARGS 4
+# define __READAHEAD_ALIGN
+#endif
+
ssize_t
__readahead (int fd, off64_t offset, size_t count)
{
- return INLINE_SYSCALL (readahead, 4, fd,
+ return INLINE_SYSCALL (readahead, __READAHEAD_ARGS, fd, __READAHEAD_ALIGN
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)),
count);