--- ./fdisk/llseek.c 2007-05-21 11:45:41.000000000 +0200
|
|
+++ ./fdisk/llseek.c 2007-05-21 11:53:14.000000000 +0200
|
|
@@ -5,6 +5,7 @@
|
|
* under the terms of the GNU Public License.
|
|
*/
|
|
|
|
+#include <sys/syscall.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <errno.h>
|
|
@@ -26,27 +27,16 @@
|
|
#else
|
|
#include <linux/unistd.h> /* for __NR__llseek */
|
|
|
|
-static int _llseek (unsigned int, unsigned long,
|
|
- unsigned long, long long *, unsigned int);
|
|
-
|
|
-#ifdef __NR__llseek
|
|
-
|
|
-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
|
|
- unsigned long, offset_low,long long *,result,
|
|
- unsigned int, origin)
|
|
-
|
|
-#else
|
|
-
|
|
-/* no __NR__llseek on compilation machine - might give it explicitly */
|
|
static int _llseek (unsigned int fd, unsigned long oh,
|
|
unsigned long ol, long long *result,
|
|
unsigned int origin) {
|
|
- errno = ENOSYS;
|
|
- return -1;
|
|
+#ifdef __NR__llseek
|
|
+ return syscall(__NR__llseek, fd, oh, ol, result, origin);
|
|
+#else
|
|
+ return result = lseek64(fd, (oh<<32) | ol, origin);
|
|
+#endif
|
|
}
|
|
|
|
-#endif
|
|
-
|
|
static long long my_llseek (unsigned int fd, long long offset,
|
|
unsigned int origin)
|
|
{
|
|
--- ./fdisk/sfdisk.c 2007-05-21 11:48:48.000000000 +0200
|
|
+++ ./fdisk/sfdisk.c 2007-05-21 11:54:32.000000000 +0200
|
|
@@ -47,6 +47,7 @@
|
|
#include <getopt.h>
|
|
#include <sys/ioctl.h>
|
|
#include <sys/stat.h>
|
|
+#include <sys/syscall.h>
|
|
#include <sys/utsname.h>
|
|
#include <linux/unistd.h> /* _syscall */
|
|
#include "nls.h"
|
|
@@ -177,9 +178,15 @@
|
|
#endif
|
|
|
|
#ifndef use_lseek
|
|
-static __attribute__used
|
|
-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
|
|
- loff_t *, res, unsigned int, wh);
|
|
+static int _llseek (unsigned int fd, unsigned long oh,
|
|
+ unsigned long ol, long long *result,
|
|
+ unsigned int origin) {
|
|
+#ifdef __NR__llseek
|
|
+ return syscall(__NR__llseek, fd, oh, ol, result, origin);
|
|
+#else
|
|
+ return result = lseek64(fd, (oh<<32) | ol, origin);
|
|
+#endif
|
|
+}
|
|
#endif
|
|
|
|
static int
|
|
--- ./partx/partx.c 2007-05-21 22:30:42.000000000 +0200
|
|
+++ ./partx/partx.c 2007-05-21 22:31:21.000000000 +0200
|
|
@@ -339,10 +339,13 @@
|
|
#endif
|
|
|
|
#ifdef NEED__llseek
|
|
+#include <sys/syscall.h>
|
|
#include <linux/unistd.h> /* _syscall */
|
|
-static
|
|
-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
|
|
- long long *, res, uint, wh);
|
|
+static int _llseek (unsigned int fd, unsigned long oh,
|
|
+ unsigned long ol, long long *result,
|
|
+ unsigned int origin) {
|
|
+ return syscall(__NR__llseek, fd, oh, ol, result, origin);
|
|
+}
|
|
#endif
|
|
|
|
static int
|