summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch b/meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch
new file mode 100644
index 0000000000..7c17a19420
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-add-posix_fadvise-for-arm.patch
@@ -0,0 +1,68 @@
1From 236a65abe0a6810e20498fc0ba8d02d90978953b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 29 Jun 2013 22:46:53 -0700
4Subject: [PATCH] add posix_fadvise() for arm
5
6arm call to posix_fadvise simply calls posix_fadvise64
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 libc/sysdeps/linux/common/posix_fadvise.c | 24 ++++++++++++++++--------
11 1 file changed, 16 insertions(+), 8 deletions(-)
12
13Upstream-Status: Pending
14
15diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c
16index d3e1bd4..e102ce7 100644
17--- a/libc/sysdeps/linux/common/posix_fadvise.c
18+++ b/libc/sysdeps/linux/common/posix_fadvise.c
19@@ -10,30 +10,38 @@
20
21 #include <sys/syscall.h>
22
23-#ifdef __NR_fadvise64
24+#if defined(__NR_fadvise64) || defined(__NR_arm_fadvise64_64)
25 # include <fcntl.h>
26 # include <endian.h>
27 # include <bits/wordsize.h>
28
29+# ifdef __NR_arm_fadvise64_64
30+int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice);
31+# endif
32+
33 int posix_fadvise(int fd, off_t offset, off_t len, int advice)
34 {
35+# ifdef __NR_arm_fadvise64_64
36+ return posix_fadvise64(fd, offset, len, advice);
37+# else
38 int ret;
39 INTERNAL_SYSCALL_DECL(err);
40-# if __WORDSIZE == 64
41+# if __WORDSIZE == 64
42 ret = INTERNAL_SYSCALL(fadvise64, err, 4, fd, offset, len, advice);
43-# else
44-# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
45- ret = INTERNAL_SYSCALL(fadvise64, err, 6, fd, /*unused*/0,
46 # else
47+# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
48+ ret = INTERNAL_SYSCALL(fadvise64, err, 6, fd, /*unused*/0,
49+# else
50 ret = INTERNAL_SYSCALL(fadvise64, err, 5, fd,
51-# endif
52+# endif
53 OFF_HI_LO (offset), len, advice);
54-# endif
55+# endif
56 if (INTERNAL_SYSCALL_ERROR_P (ret, err))
57 return INTERNAL_SYSCALL_ERRNO (ret, err);
58 return 0;
59+# endif
60 }
61-# if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || __WORDSIZE == 64)
62+# if defined __UCLIBC_HAS_LFS__ && ((!defined __NR_fadvise64_64 && !defined __NR_arm_fadvise64_64) || __WORDSIZE == 64)
63 strong_alias(posix_fadvise,posix_fadvise64)
64 # endif
65 #endif
66--
671.7.9.5
68