summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/parted/parted-2.3/syscalls.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/parted/parted-2.3/syscalls.patch')
-rw-r--r--meta/recipes-extended/parted/parted-2.3/syscalls.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-extended/parted/parted-2.3/syscalls.patch b/meta/recipes-extended/parted/parted-2.3/syscalls.patch
new file mode 100644
index 0000000000..6be49968f3
--- /dev/null
+++ b/meta/recipes-extended/parted/parted-2.3/syscalls.patch
@@ -0,0 +1,53 @@
1---
2 libparted/arch/linux.c | 13 +++++++++++++
3 1 file changed, 13 insertions(+)
4
5Index: parted-1.9.0/libparted/arch/linux.c
6===================================================================
7--- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100
8+++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000
9@@ -17,6 +17,8 @@
10
11 #define PROC_DEVICES_BUFSIZ 16384
12
13+#include <linux/version.h>
14+
15 #include <config.h>
16 #include <arch/linux.h>
17
18@@ -1477,12 +1479,14 @@
19
20 #if SIZEOF_OFF_T < 8
21
22+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
23 static _syscall5(int,_llseek,
24 unsigned int, fd,
25 unsigned long, offset_high,
26 unsigned long, offset_low,
27 loff_t*, result,
28 unsigned int, origin)
29+#endif
30
31 loff_t
32 llseek (unsigned int fd, loff_t offset, unsigned int whence)
33@@ -1490,11 +1494,20 @@
34 loff_t result;
35 int retval;
36
37+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
38 retval = _llseek(fd,
39 ((unsigned long long)offset) >> 32,
40 ((unsigned long long)offset) & 0xffffffff,
41 &result,
42 whence);
43+#else
44+ retval = syscall(__NR__llseek, fd,
45+ ((unsigned long long)offset) >> 32,
46+ ((unsigned long long)offset) & 0xffffffff,
47+ &result,
48+ whence);
49+#endif
50+
51 return (retval==-1 ? (loff_t) retval : result);
52 }
53