summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/posix_fadvise64.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-02-20 12:24:26 -0600
committerWaldemar Brodkorb <wbx@openadk.org>2015-02-20 12:24:26 -0600
commitd4389d613cc49f776fffe5ee0f9af854e9a93074 (patch)
treeacb65e19f6482e2599e31003c9a811154580a23c /libc/sysdeps/linux/common/posix_fadvise64.c
parent42e9e0a0406473a9b017342eaffc03c85f9bb51b (diff)
parent409f14d9b5e47513d5c939120a33965997c8ceb2 (diff)
sync with uClibc
Diffstat (limited to 'libc/sysdeps/linux/common/posix_fadvise64.c')
-rw-r--r--libc/sysdeps/linux/common/posix_fadvise64.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c
index 5d8989121..37fb269ca 100644
--- a/libc/sysdeps/linux/common/posix_fadvise64.c
+++ b/libc/sysdeps/linux/common/posix_fadvise64.c
@@ -24,9 +24,18 @@ int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice)
{
INTERNAL_SYSCALL_DECL (err);
/* ARM has always been funky. */
-# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) || defined(__arm__)
+#if defined (__arm__) || \
+ (defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) && (defined(__powerpc__) || defined(__xtensa__)))
+ /* arch with 64-bit data in even reg alignment #1: [powerpc/xtensa]
+ * custom syscall handler (rearranges @advice to avoid register hole punch) */
int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
OFF64_HI_LO (offset), OFF64_HI_LO (len));
+#elif defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
+ /* arch with 64-bit data in even reg alignment #2: [arcv2/others-in-future]
+ * stock syscall handler in kernel (reg hole punched) */
+ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 7, fd, 0,
+ OFF64_HI_LO (offset), OFF64_HI_LO (len),
+ advice);
# else
int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
OFF64_HI_LO (offset), OFF64_HI_LO (len),