sg3_utils/sg3_utils.diff

58 lines
1.6 KiB
Diff

Index: archive/llseek.c
===================================================================
--- archive/llseek.c.orig
+++ archive/llseek.c
@@ -9,9 +9,9 @@
* Changed "ext2_" prefix to "llse".
*/
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
-
+#define _LARGEFILE64_SOURCE 1
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
@@ -30,9 +30,9 @@ extern llse_loff_t llse_llseek (unsigned
#include <syscall.h>
#else /* HAVE_LLSEEK */
-#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
+#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__) || defined (__x86_64__) || defined (__powerpc64__)
#define my_llseek lseek
#else
@@ -42,12 +42,8 @@ static int _llseek (unsigned int, unsign
unsigned long, llse_loff_t *, unsigned int);
#ifdef __NR__llseek
-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
- unsigned long, offset_low,llse_loff_t *,result,
- unsigned int, origin)
-
#else
/* no __NR__llseek on compilation machine - might give it explicitly */
static int _llseek (unsigned int fd, unsigned long oh,
@@ -63,13 +59,16 @@ static llse_loff_t my_llseek (unsigned i
unsigned int origin)
{
llse_loff_t result;
int retval;
-
+#if 0
retval = _llseek (fd, ((uint64_t) offset) >> 32,
((uint64_t) offset) & 0xffffffff,
&result, origin);
return (retval == -1 ? (llse_loff_t) retval : result);
+#else
+ return lseek64 (fd, offset, origin);
+#endif
}
#endif /* __alpha__ */