public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Subrata Modak <subrata@linux.vnet.ibm.com>
Cc: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] broken epoll Makefile
Date: Mon, 7 Sep 2009 18:02:22 +0200	[thread overview]
Message-ID: <20090907160222.GA29017@schrodinger.suse.cz> (raw)
In-Reply-To: <1252324203.4922.37.camel@subratamodak.linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

Hi!
> > Working on. Should be hopefully finished today.
> 
> Great.

After trying to find old enough glibc (2.2.2 and older) in any distribution
I've given up modifying the test to compile with non glibc epoll library. So
when glibc epoll headers are not found the test is disabled entirely and dummy
version of the test is compiled. Patch that also fixes some minor problems is 
attached.

Signed-off-by: Cyril Hrubis chrubis@suse.cz


Also there are several directories that doesn't contain Makefile (or any files)
so the are not used or not compiled anyway. IMHO they should be removed. For
example in CVS tree:

in testcases/kernel/syscals/

epoll2
epoll_create2
create_module
destroy_module
getcontext01 
...

Empty directories are not exported to releases. At least it seems so, but still
there are directories containing useless data, for example epoll2.

-- 
Cyril Hrubis
chrubis@suse.cz

[-- Attachment #2: configure_epoll.patch --]
[-- Type: text/x-patch, Size: 4822 bytes --]

Index: ltp/configure.ac
===================================================================
--- ltp.orig/configure.ac
+++ ltp/configure.ac
@@ -13,6 +13,7 @@ AC_CHECK_HEADERS_ONCE([ \
 ifaddrs.h \
 sys/capability.h \
 sys/inotify.h \
+sys/epoll.h \
 ])
 
 LTP_CHECK_SYSCALL_EVENTFD
Index: ltp/testcases/kernel/syscalls/epoll/Makefile
===================================================================
--- ltp.orig/testcases/kernel/syscalls/epoll/Makefile
+++ ltp/testcases/kernel/syscalls/epoll/Makefile
@@ -19,14 +19,6 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-LIBC_HAS_EPOLL := $(shell echo '\#include <sys/epoll.h>' | $(CC) -E - > /dev/null 2>&1 && echo yes)
-ifeq ($(LIBC_HAS_EPOLL),yes)
-CFLAGS += -DLTP_EPOLL_USE_SYS_LIBC
-else
-CFLAGS += -I. -DLTP_EPOLL_USE_LIB
-LDLIBS += -lepoll
-endif
-
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
 
Index: ltp/testcases/kernel/syscalls/epoll/epoll-ltp.c
===================================================================
--- ltp.orig/testcases/kernel/syscalls/epoll/epoll-ltp.c
+++ ltp/testcases/kernel/syscalls/epoll/epoll-ltp.c
@@ -71,7 +71,7 @@
 *******************************************************************************/
 
 #ifndef _GNU_SOURCE
-# define _GNU_SOURCE
+#define _GNU_SOURCE
 #endif
 
 #include <stdio.h>
@@ -95,14 +95,15 @@
 #include <sys/select.h>
 #include <sys/wait.h>
 
-#ifdef LTP_EPOLL_USE_LIB
-# include <epoll.h>
-#else
-# include <sys/epoll.h>
-#endif
-
-/* Harness Specific Include Files. */
+#include "config.h"
 #include "test.h"
+
+char *TCID = "sys_epoll02";	/* test program identifier */
+int TST_TOTAL = 1;		/* total number of tests in this file */
+
+#ifdef HAVE_SYS_EPOLL_H
+
+#include <sys/epoll.h>
 #include "usctest.h"
 
 /* Local Defines */
@@ -114,11 +115,6 @@
 #define NUM_RAND_ATTEMPTS 16
 #define BACKING_STORE_SIZE_HINT 32
 
-/* Dummy function for tst_brk* */
-extern void cleanup(void)
-{
-}
-
 /*
   Define the beginning of a "protected region".
   This is a region where a wide variety of errors
@@ -202,9 +198,6 @@ kid_status = kid_status;})
 extern int Tst_count;		/* counter for tst_xxx routines */
 extern char *TESTDIR;		/* temporary dir created by tst_tmpdir() */
 
-/* Global Variables */
-char *TCID = "sys_epoll02";	/* test program identifier */
-int TST_TOTAL = 1;		/* total number of tests in this file */
 
 /*
  * Given the number of random size requests to test,
@@ -367,7 +360,7 @@ static const char *result_strings[] = {
 	if (ev_ptr != NULL){ \
 		tst_resm(TFAIL, ( "(epoll_ctl(%d,%08x,%d,%p = {%08x,%08d}) returned %d:%s)" ) , ##__VA_ARGS__ , \
 			epoll_fds[epfd_index], epoll_ctl_ops[op_index], \
-			epoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data, errno, \
+			epoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data.fd, errno, \
 			strerror(errno)); \
 	} else { \
 		tst_resm(TFAIL, ( "(epoll_ctl(%d,%08x,%d,%p) returned %d:%s)" ) , ##__VA_ARGS__  , \
@@ -381,7 +374,7 @@ static const char *result_strings[] = {
 	if (ev_ptr != NULL){ \
 		tst_resm(TPASS, ( "(epoll_ctl(%d,%08x,%d,%p = {%08x,%08d}) returned %d:%s)" ) , ##__VA_ARGS__ , \
 			epoll_fds[epfd_index], epoll_ctl_ops[op_index], \
-			epoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data, errno, \
+			epoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data.fd, errno, \
 			strerror(errno)); \
 	} else { \
 		tst_resm(TPASS, ( "(epoll_ctl(%d,%08x,%d,%p) returned %d:%s)" ) , ##__VA_ARGS__  , \
@@ -390,8 +383,8 @@ static const char *result_strings[] = {
 	} \
 })
 #else
-#define EPOLL_CTL_TEST_FAIL(msg , ...) tst_resm(TFAIL, (const char*)(msg) , ##__VA_ARGS__)
-#define EPOLL_CTL_TEST_PASS(msg , ...) tst_resm(TPASS, (const char*)(msg) , ##__VA_ARGS__)
+#define EPOLL_CTL_TEST_FAIL(msg , ...) tst_resm(TFAIL, msg , ##__VA_ARGS__)
+#define EPOLL_CTL_TEST_PASS(msg , ...) tst_resm(TPASS, msg , ##__VA_ARGS__)
 #endif
 
 /****************************************************************************************/
@@ -642,12 +635,6 @@ int test_epoll_ctl(int epoll_fd)
 						} else	/* The call of epoll_ctl behaved as expected */
 							EPOLL_CTL_TEST_PASS((result_strings
 									     [result]));
-
-/* Just to be safe, undefine our macros */
-#undef EPOLL_CTL_TEST_FAIL
-#undef EPOLL_CTL_TEST_PASS
-#undef PROTECT_REGION_BEGIN
-#undef PROTECT_REGION_END
 					}
 				}
 			}
@@ -673,7 +660,7 @@ int main(int argc, char **argv)
 
 	/* Get the current time */
 	if (gettimeofday(&tv, NULL) != 0) {
-		tst_brkm(TBROK, cleanup, "gettimeofday failed");
+		tst_brkm(TBROK, NULL, "gettimeofday failed");
 		tst_exit();
 	} else {
 		tst_resm(TINFO, "gettimeofday() works");
@@ -704,3 +691,13 @@ int main(int argc, char **argv)
 
 	return 0;
 }
+
+#else
+
+int main(void)
+{
+	tst_resm(TINFO, "Epoll library was missing in compilation.");
+	tst_exit();
+}
+
+#endif

[-- Attachment #3: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

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

  parent reply	other threads:[~2009-09-07 16:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 17:41 [LTP] broken epoll Makefile Cyril Hrubis
     [not found] ` <1252323725.4922.33.camel@subratamodak.linux.ibm.com>
2009-09-07 11:47   ` Cyril Hrubis
     [not found]     ` <1252324203.4922.37.camel@subratamodak.linux.ibm.com>
2009-09-07 16:02       ` Cyril Hrubis [this message]
     [not found]         ` <200909072235.00963.vapier@gentoo.org>
2009-09-09 12:31           ` [LTP] [PATCH] " Cyril Hrubis
     [not found]             ` <200909090844.25484.vapier@gentoo.org>
2009-09-09 13:07               ` Cyril Hrubis
2009-09-17 12:03         ` Cyril Hrubis
     [not found]           ` <200909171053.28153.vapier@gentoo.org>
2009-09-17 15:31             ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090907160222.GA29017@schrodinger.suse.cz \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=subrata@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox