Package: sg-utils
Version: 1.02-3
Severity: serious
Tags: patch

sg-utils fails to build from source using linux-kernel-headers >=
2.6.18.

> gcc -g -O2 -Wall -D_REENTRANT   -c -o llseek.o llseek.c
> llseek.c:44: error: expected declaration specifiers or ‘...’ before ‘_llseek’
> llseek.c:44: error: expected declaration specifiers or ‘...’ before ‘fd’
> llseek.c:44: error: expected declaration specifiers or ‘...’ before 
> ‘offset_high

This is due to new syscall usage. A patch is attached.

-Ted

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-2-k7
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
diff -ru sg-utils-1.02/llseek.c sg-utils-1.02-new/llseek.c
--- sg-utils-1.02/llseek.c	2000-12-09 09:50:02.000000000 +1000
+++ sg-utils-1.02-new/llseek.c	2006-10-23 22:04:07.000000000 +1000
@@ -24,30 +24,21 @@
 
 #ifdef __linux__
 
-#ifdef HAVE_LLSEEK
-#include <syscall.h>
-
-#else	/* HAVE_LLSEEK */
-
 #if defined(__alpha__) || defined(__ia64__)
 
 #define my_llseek lseek
 
 #else
-#include <linux/unistd.h>	/* for __NR__llseek */
+#include <sys/syscall.h>	/* for SYS__llseek */
 
-static int _llseek (unsigned int, unsigned long,
-		   unsigned long, llse_loff_t *, unsigned int);
+#ifdef SYS__llseek
 
-#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)
+#define _llseek(fd, offset_high, offset_low, result, origin) \
+	syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
 
 #else
 
-/* no __NR__llseek on compilation machine - might give it explicitly */
+/* no SYS__llseek on compilation machine - might give it explicitly */
 static int _llseek (unsigned int fd, unsigned long oh,
 		    unsigned long ol, llse_loff_t *result,
 		    unsigned int origin) {
@@ -71,8 +62,6 @@
 
 #endif /* __alpha__ */
 
-#endif	/* HAVE_LLSEEK */
-
 llse_loff_t llse_llseek (unsigned int fd, llse_loff_t offset,
 			 unsigned int origin)
 {

Reply via email to