Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | --- |
| 4 | libparted/arch/linux.c | 13 +++++++++++++ |
| 5 | 1 file changed, 13 insertions(+) |
| 6 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 7 | Index: parted-3.2/libparted/arch/linux.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | --- parted-3.2.orig/libparted/arch/linux.c |
| 10 | +++ parted-3.2/libparted/arch/linux.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | @@ -17,6 +17,8 @@ |
| 12 | |
| 13 | #define PROC_DEVICES_BUFSIZ 16384 |
| 14 | |
| 15 | +#include <linux/version.h> |
| 16 | + |
| 17 | #include <config.h> |
| 18 | #include <arch/linux.h> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | #include <linux/blkpg.h> |
| 20 | @@ -1696,12 +1698,14 @@ linux_refresh_close (PedDevice* dev) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | |
| 22 | #if SIZEOF_OFF_T < 8 |
| 23 | |
| 24 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 25 | static _syscall5(int,_llseek, |
| 26 | unsigned int, fd, |
| 27 | unsigned long, offset_high, |
| 28 | unsigned long, offset_low, |
| 29 | loff_t*, result, |
| 30 | unsigned int, origin) |
| 31 | +#endif |
| 32 | |
| 33 | loff_t |
| 34 | llseek (unsigned int fd, loff_t offset, unsigned int whence) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 35 | @@ -1709,11 +1713,20 @@ llseek (unsigned int fd, loff_t offset, |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | loff_t result; |
| 37 | int retval; |
| 38 | |
| 39 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |
| 40 | retval = _llseek(fd, |
| 41 | ((unsigned long long)offset) >> 32, |
| 42 | ((unsigned long long)offset) & 0xffffffff, |
| 43 | &result, |
| 44 | whence); |
| 45 | +#else |
| 46 | + retval = syscall(__NR__llseek, fd, |
| 47 | + ((unsigned long long)offset) >> 32, |
| 48 | + ((unsigned long long)offset) & 0xffffffff, |
| 49 | + &result, |
| 50 | + whence); |
| 51 | +#endif |
| 52 | + |
| 53 | return (retval==-1 ? (loff_t) retval : result); |
| 54 | } |
| 55 | |