Hi,

I report a build failure and a patch for it.

If your kernel is version 2.6.16 or prior,
build fails because of missing splice() syscall.

$ make all
  :
make[4]: Entering directory 
`/home/ikarashi/ltp/testcases/kernel/syscalls/splice'
gcc -g -O2 -I../../include -g -Wall -I../../../../include -Wall    splice01.c  
-L../../../../lib -lltp -o splice01
gcc -g -O2 -I../../include -g -Wall -I../../../../include -Wall    splice02.c  
-L../../../../lib -lltp -o splice02
splice02.c: In function `main':
splice02.c:127: warning: implicit declaration of function `splice'
/tmp/ccUKoMla.o(.text+0x282): In function `main':
/home/ikarashi/ltp/testcases/kernel/syscalls/splice/splice02.c:127: undefined 
reference to `splice'
collect2: ld returned 1 exit status
make[4]: *** [splice02] Error 1
make[4]: Leaving directory `/home/ikarashi/ltp/testcases/kernel/syscalls/splice'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/ikarashi/ltp/testcases/kernel/syscalls'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/ikarashi/ltp/testcases/kernel'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ikarashi/ltp/testcases'
make: *** [all] Error 2
$ 


This patch adds a workaround from splice01.c to splice02.c.

Signed-off-by: Seiichi Ikarashi <[email protected]>

Regards,
--- a/testcases/kernel/syscalls/splice/splice02.c	2009-04-15 15:25:58.000000000 +0900
+++ b/testcases/kernel/syscalls/splice/splice02.c	2009-04-28 11:02:07.000000000 +0900
@@ -106,10 +106,24 @@ void setup() {
 
 #define SPLICE_SIZE (64*1024)
 
+static inline long splice(int fd_in, loff_t * off_in,
+			  int fd_out, loff_t * off_out,
+			  size_t len, unsigned int flags)
+{
+	return syscall(__NR_splice, fd_in, off_in, fd_out, off_out, len, flags);
+}
+
 int main(int ac, char **av) {
 	int fd = 0;
 	int ret = 0;
 	
+	/* Disable test if the version of the kernel is less than 2.6.17 */
+	if (((ret = tst_kvercmp(2, 6, 17)) < 0)) {
+		tst_resm(TINFO, "This test can only run on kernels that are ");
+		tst_resm(TINFO, "2.6.17 and higher");
+		exit(0);
+	}
+
         setup();
 
         if (ac < 2 ) {
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to