public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] Fix eventfd2_03 build failure on powerpc architecture
@ 2009-07-01 22:08 Lucio
  2009-07-06 15:50 ` Subrata Modak
  0 siblings, 1 reply; 2+ messages in thread
From: Lucio @ 2009-07-01 22:08 UTC (permalink / raw)
  To: LTP List

Hi, 

I've found a failure when building ltp-full-20090630 on powerpc:

eventfd2_03.c:48:2: error: #error Cannot detect your architecture!
eventfd2_03.c: In function ‘eventfd2’:
eventfd2_03.c:54: error: ‘__NR_eventfd2’ undeclared (first use in this function)
eventfd2_03.c:54: error: (Each undeclared identifier is reported only once
eventfd2_03.c:54: error: for each function it appears in.)
eventfd2_03.c: In function ‘main’:
eventfd2_03.c:129: warning: implicit declaration of function ‘waitpid’
make[4]: *** [eventfd2_03] Error 1
make[4]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls/eventfd2'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/ltp-full-20090630/testcases/kernel'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ltp-full-20090630/testcases'
make: *** [all] Error 2


This patch fixes the failure, the test program identifier and 
adds a kernel version check.


Signed-off-by Lucio Correia <ljhc@br.ibm.com>

diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc64.in ltp-full-20090630.new/testcases/kernel/include/powerpc64.in
--- ltp-full-20090630/testcases/kernel/include/powerpc64.in	2008-12-12 13:13:18.000000000 -0200
+++ ltp-full-20090630.new/testcases/kernel/include/powerpc64.in	2009-07-01 18:35:52.000000000 -0300
@@ -20,6 +20,7 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314
diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc.in ltp-full-20090630.new/testcases/kernel/include/powerpc.in
--- ltp-full-20090630/testcases/kernel/include/powerpc.in	2009-07-01 18:08:33.000000000 -0300
+++ ltp-full-20090630.new/testcases/kernel/include/powerpc.in	2009-07-01 18:24:24.000000000 -0300
@@ -20,7 +20,8 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314
 __NR_perf_counter_open 319
diff -Nurp ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
--- ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c	2009-06-15 15:26:34.000000000 -0300
+++ ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c	2009-07-01 18:50:26.000000000 -0300
@@ -33,22 +33,17 @@
 #include <unistd.h>
 #include <errno.h>
 
-char *TCID = "eventfd2_02";     /* test program identifier*/
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "linux_syscall_numbers.h"
+
+char *TCID = "eventfd2_03";     /* test program identifier*/
+int TST_TOTAL = 1;	        	/* total number of tests in this file */
 
 #ifndef EFD_SEMLIKE
 #define EFD_SEMLIKE (1 << 0)
 #endif
 
-#ifndef __NR_eventfd2
-#if defined(__x86_64__)
-#define __NR_eventfd2 290
-#elif defined(__i386__)
-#define __NR_eventfd2 328
-#else
-#error Cannot detect your architecture!
-#endif
-#endif
-
 
 static int eventfd2(int count, int flags) {
 	return syscall(__NR_eventfd2, count, flags);
@@ -113,6 +108,11 @@ int main (int argc, char **argv) {
 			return 1;
 		}
 	}
+	if ((tst_kvercmp(2, 6, 27)) < 0) {
+		tst_resm(TCONF,
+			 "This test can only run on kernels that are 2.6.27 and higher");
+		tst_exit();
+	}
 	if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
 	    (fd2 = eventfd2(0, EFD_SEMLIKE)) == -1) {
 		perror("eventfd2");


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] Fix eventfd2_03 build failure on powerpc architecture
  2009-07-01 22:08 [LTP] [PATCH] Fix eventfd2_03 build failure on powerpc architecture Lucio
@ 2009-07-06 15:50 ` Subrata Modak
  0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2009-07-06 15:50 UTC (permalink / raw)
  To: ljhc; +Cc: LTP List

On Wed, 2009-07-01 at 19:08 -0300, Lucio wrote: 
> Hi, 
> 
> I've found a failure when building ltp-full-20090630 on powerpc:
> 
> eventfd2_03.c:48:2: error: #error Cannot detect your architecture!
> eventfd2_03.c: In function ‘eventfd2’:
> eventfd2_03.c:54: error: ‘__NR_eventfd2’ undeclared (first use in this function)
> eventfd2_03.c:54: error: (Each undeclared identifier is reported only once
> eventfd2_03.c:54: error: for each function it appears in.)
> eventfd2_03.c: In function ‘main’:
> eventfd2_03.c:129: warning: implicit declaration of function ‘waitpid’
> make[4]: *** [eventfd2_03] Error 1
> make[4]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls/eventfd2'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/root/ltp-full-20090630/testcases/kernel'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/root/ltp-full-20090630/testcases'
> make: *** [all] Error 2
> 
> 
> This patch fixes the failure, the test program identifier and 
> adds a kernel version check.
> 
> 
> Signed-off-by Lucio Correia <ljhc@br.ibm.com>

Thanks.

Regards--
Subrata

> 
> diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc64.in ltp-full-20090630.new/testcases/kernel/include/powerpc64.in
> --- ltp-full-20090630/testcases/kernel/include/powerpc64.in	2008-12-12 13:13:18.000000000 -0200
> +++ ltp-full-20090630.new/testcases/kernel/include/powerpc64.in	2009-07-01 18:35:52.000000000 -0300
> @@ -20,6 +20,7 @@ __NR_symlinkat (__NR_openat + 9)
>  __NR_readlinkat (__NR_openat + 10)
>  __NR_fchmodat  (__NR_openat + 11)
>  __NR_faccessat (__NR_openat + 12)
> +__NR_utimensat 304
>  __NR_eventfd 307
>  __NR_fallocate 309
> -__NR_utimensat 304
> +__NR_eventfd2 314
> diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc.in ltp-full-20090630.new/testcases/kernel/include/powerpc.in
> --- ltp-full-20090630/testcases/kernel/include/powerpc.in	2009-07-01 18:08:33.000000000 -0300
> +++ ltp-full-20090630.new/testcases/kernel/include/powerpc.in	2009-07-01 18:24:24.000000000 -0300
> @@ -20,7 +20,8 @@ __NR_symlinkat (__NR_openat + 9)
>  __NR_readlinkat (__NR_openat + 10)
>  __NR_fchmodat  (__NR_openat + 11)
>  __NR_faccessat (__NR_openat + 12)
> +__NR_utimensat 304
>  __NR_eventfd 307
>  __NR_fallocate 309
> -__NR_utimensat 304
> +__NR_eventfd2 314
>  __NR_perf_counter_open 319
> diff -Nurp ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
> --- ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c	2009-06-15 15:26:34.000000000 -0300
> +++ ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c	2009-07-01 18:50:26.000000000 -0300
> @@ -33,22 +33,17 @@
>  #include <unistd.h>
>  #include <errno.h>
>  
> -char *TCID = "eventfd2_02";     /* test program identifier*/
> +/* Harness Specific Include Files. */
> +#include "test.h"
> +#include "linux_syscall_numbers.h"
> +
> +char *TCID = "eventfd2_03";     /* test program identifier*/
> +int TST_TOTAL = 1;	        	/* total number of tests in this file */
>  
>  #ifndef EFD_SEMLIKE
>  #define EFD_SEMLIKE (1 << 0)
>  #endif
>  
> -#ifndef __NR_eventfd2
> -#if defined(__x86_64__)
> -#define __NR_eventfd2 290
> -#elif defined(__i386__)
> -#define __NR_eventfd2 328
> -#else
> -#error Cannot detect your architecture!
> -#endif
> -#endif
> -
>  
>  static int eventfd2(int count, int flags) {
>  	return syscall(__NR_eventfd2, count, flags);
> @@ -113,6 +108,11 @@ int main (int argc, char **argv) {
>  			return 1;
>  		}
>  	}
> +	if ((tst_kvercmp(2, 6, 27)) < 0) {
> +		tst_resm(TCONF,
> +			 "This test can only run on kernels that are 2.6.27 and higher");
> +		tst_exit();
> +	}
>  	if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
>  	    (fd2 = eventfd2(0, EFD_SEMLIKE)) == -1) {
>  		perror("eventfd2");
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-06 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 22:08 [LTP] [PATCH] Fix eventfd2_03 build failure on powerpc architecture Lucio
2009-07-06 15:50 ` Subrata Modak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox