diff -ur gpart-0.1h.orig/src/disku.c gpart-0.1h/src/disku.c --- gpart-0.1h.orig/src/disku.c 2001-02-07 21:04:07.000000000 +0200 +++ gpart-0.1h/src/disku.c 2007-09-27 13:18:13.000000000 +0300 @@ -27,10 +27,10 @@ #endif #if defined(__FreeBSD__) -#include #include #endif +#include /* diff -ur gpart-0.1h.orig/src/l64seek.c gpart-0.1h/src/l64seek.c --- gpart-0.1h.orig/src/l64seek.c 2000-12-14 00:54:11.000000000 +0200 +++ gpart-0.1h/src/l64seek.c 2007-09-27 15:34:20.000000000 +0300 @@ -16,6 +16,7 @@ #include "l64seek.h" +#include #define OSTACKLEN 16 static struct @@ -26,6 +27,29 @@ static int osptr = -1; #if defined(__linux__) && defined(__i386__) +#define __syscall_return(type, res) \ +do { \ + if ((unsigned long)(res) >= (unsigned long)(-(128 + 1))) { \ + errno = -(res); \ + res = -1; \ + } \ + return (type) (res); \ +} while (0) + +#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5) \ +type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ +{ \ +long __res; \ +__asm__ volatile ("push %%ebx ; movl %2,%%ebx ; movl %1,%%eax ; " \ + "int $0x80 ; pop %%ebx" \ + : "=a" (__res) \ + : "i" (__NR_##name),"ri" ((long)(arg1)),"c" ((long)(arg2)), \ + "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5)) \ + : "memory"); \ +__syscall_return(type,__res); \ +} + _syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh) #endif