diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fcntl/arm/posix_fadvise.c | 12 | ||||
-rw-r--r-- | src/fcntl/posix_fadvise.c | 8 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/fcntl/arm/posix_fadvise.c b/src/fcntl/arm/posix_fadvise.c deleted file mode 100644 index 5c52f6b8..00000000 --- a/src/fcntl/arm/posix_fadvise.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <fcntl.h> -#include "syscall.h" -#include "libc.h" - -int posix_fadvise(int fd, off_t base, off_t len, int advice) -{ - /* ARM-specific syscall argument order */ - return -__syscall(SYS_fadvise, fd, advice, - __SYSCALL_LL_E(base), __SYSCALL_LL_E(len)); -} - -LFS64(posix_fadvise); diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c index fc1562e2..c1a0ef5a 100644 --- a/src/fcntl/posix_fadvise.c +++ b/src/fcntl/posix_fadvise.c @@ -4,8 +4,16 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice) { +#if defined(SYSCALL_FADVISE_6_ARG) + /* Some archs, at least arm and powerpc, have the syscall + * arguments reordered to avoid needing 7 argument registers + * due to 64-bit argument alignment. */ + return -__syscall(SYS_fadvise, fd, advice, + __SYSCALL_LL_E(base), __SYSCALL_LL_E(len)); +#else return -__syscall(SYS_fadvise, fd, __SYSCALL_LL_O(base), __SYSCALL_LL_E(len), advice); +#endif } LFS64(posix_fadvise); |