On Thu, 2008-12-25 at 18:10 +0900, Masatake YAMATO wrote:
> > Could you retry new patch?
> 
> Sorry I forgot to put my Signed-off-by line to the patch.
> 
> Signed-off-by: Masatake YAMATO <yam...@redhat.com>

Thanks Yamato.

However, this creates a build error for me even after a fresh clean &
automake:

cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
eventfd01.c  -L../../../../lib -laio -lltp -o eventfd01
eventfd01.c: In function ‘trigger_eventfd_overflow’:
eventfd01.c:578: warning: implicit declaration of function
‘io_set_eventfd’
/tmp/ccmgRUkr.o: In function `trigger_eventfd_overflow':
ltp-intermediate-20081228/testcases/kernel/syscalls/eventfd/eventfd01.c:578: 
undefined reference to `io_set_eventfd'
collect2: ld returned 1 exit status
make[4]: *** [eventfd01] Error 1

Regards--
Subrata

> 
> diff --git a/config.mk.in b/config.mk.in
> new file mode 100644
> index 0000000..22bad68
> --- /dev/null
> +++ b/config.mk.in
> @@ -0,0 +1 @@
> +AIO_LIBS = @AIO_LIBS@
> diff --git a/configure.ac b/configure.ac
> index e137d5b..b5f0d30 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1,6 +1,7 @@
>  AC_PREREQ([2.61])
>  AC_INIT([ltp], [cvs], [ltp-resu...@lists.sourceforge.net])
>  AC_CONFIG_HEADERS([include/config.h])
> +AC_CONFIG_FILES([config.mk])
> 
> 
>  m4_include([m4/ltp-signalfd.m4])
> @@ -9,6 +10,11 @@ LTP_CHECK_SYSCALL_SIGNALFD
>  m4_include([m4/ltp-modify_ldt.m4])
>  LTP_CHECK_SYSCALL_MODIFY_LDT
> 
> +m4_include([m4/ltp-eventfd.m4])
> +LTP_CHECK_SYSCALL_EVENTFD
> +
> +AC_CHECK_HEADERS([sys/inotify.h])
> +
>  AC_CHECK_HEADERS([ifaddrs.h])
> 
>  AC_OUTPUT
> diff --git a/m4/ltp-eventfd.m4 b/m4/ltp-eventfd.m4
> new file mode 100644
> index 0000000..12a0321
> --- /dev/null
> +++ b/m4/ltp-eventfd.m4
> @@ -0,0 +1,44 @@
> +dnl
> +dnl Copyright (c) Red Hat Inc., 2008
> +dnl
> +dnl This program is free software;  you can redistribute it and/or modify
> +dnl it under the terms of the GNU General Public License as published by
> +dnl the Free Software Foundation; either version 2 of the License, or
> +dnl (at your option) any later version.
> +dnl
> +dnl This program is distributed in the hope that it will be useful,
> +dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
> +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> +dnl the GNU General Public License for more details.
> +dnl
> +dnl You should have received a copy of the GNU General Public License
> +dnl along with this program;  if not, write to the Free Software
> +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> +dnl
> +dnl Author: Masatake YAMATO <yam...@redhat.com>
> +dnl
> +
> +dnl
> +dnl LTP_CHECK_SYSCALL_EVENTFD
> +dnl ----------------------------
> +dnl
> +AC_DEFUN([LTP_CHECK_SYSCALL_EVENTFD],
> +[dnl
> +AH_TEMPLATE(HAVE_IO_SET_EVENTFD, 
> +[Define to 1 if you have the `io_set_eventfd' function.])
> +AC_CHECK_HEADERS(libaio.h,[
> +     AC_CHECK_LIB(aio,io_setup,[
> +             LIBS="$LIBS -laio"
> +             AIO_LIBS="-laio"
> +             AC_MSG_CHECKING([io_set_eventfd is defined in aio library or 
> aio header])
> +             AC_TRY_LINK([#include <stdio.h>
> +                             #include <libaio.h>
> +                         ],
> +                            [int main() { io_set_eventfd(NULL, 0); return 0; 
> }
> +                         ],
> +                         [AC_DEFINE(HAVE_IO_SET_EVENTFD)
> +                          AC_MSG_RESULT(yes)],
> +                            [AC_MSG_RESULT(no)])],
> +             AIO_LIBS="")])
> +AC_SUBST(AIO_LIBS)
> +])
> diff --git a/testcases/kernel/syscalls/eventfd/Makefile 
> b/testcases/kernel/syscalls/eventfd/Makefile
> index fc31597..6073b6b 100644
> --- a/testcases/kernel/syscalls/eventfd/Makefile
> +++ b/testcases/kernel/syscalls/eventfd/Makefile
> @@ -16,42 +16,17 @@
>  #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>  #
> 
> -include ../utils/cond.mk
> +
> +include ../../../../config.mk
> 
> 
>  CFLAGS += -I../../../../include -Wall
> -LDLIBS += -L../../../../lib -lltp
> -
> -check_aio_eventfd = $(shell \
> -     if printf \
> -     "\#include <libaio.h>\n\
> -     int main() \
> -     { \
> -     io_set_eventfd(NULL, 0); \
> -     return 0; \
> -     }" | $(CC) -xc -laio - > /dev/null 2>&1 ; \
> -     then echo yes ; \
> -     else echo no ; fi)
> -
> -HAS_LIBAIO = $(call check_header,libaio.h)
> -HAS_LIBAIO_EVENTFD = $(call check_aio_eventfd)
> -
> -ifeq ($(HAS_LIBAIO_EVENTFD),yes)
> -CFLAGS += -DHAS_AIO_EVENTFD
> -LDLIBS += -laio
> -endif
> +LDLIBS += -L../../../../lib $(AIO_LIBS) -lltp
> 
>  SRCS    = $(wildcard *.c)
>  TARGETS = $(patsubst %.c, %, $(wildcard *.c))
> 
>  all: $(TARGETS)
> -ifeq ($(HAS_LIBAIO),no)
> -     @echo "Note: Libaio is required for eventfd overflow testing.";
> -else
> -ifeq ($(HAS_LIBAIO_EVENTFD),no)
> -     @echo "Note: Eventfd support is required in libaio for overflow 
> testing.";
> -endif
> -endif
> 
>  install:
>       @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
> diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c 
> b/testcases/kernel/syscalls/eventfd/eventfd01.c
> index 4cf0bc4..2eac57d 100644
> --- a/testcases/kernel/syscalls/eventfd/eventfd01.c
> +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c
> @@ -44,6 +44,8 @@
>   *   None
>   */
> 
> +#include "config.h"
> +
>  #include <sys/select.h>
>  #include <sys/signal.h>
>  #include <sys/types.h>
> @@ -59,21 +61,27 @@
>  #include <usctest.h>
>  #include <linux_syscall_numbers.h>
> 
> -#ifdef HAS_AIO_EVENTFD
> +#ifdef HAVE_LIBAIO_H
>  #include <libaio.h>
>  #endif
> 
>  static void setup(void);
>  static void cleanup(void);
> 
> -char *TCID = "eventfd01";
> +TCID_DEFINE(eventfd01);
>  int TST_TOTAL = 15;
>  extern int Tst_count;
> 
>  static int
>  myeventfd(unsigned int initval, int flags)
>  {
> -     return syscall(__NR_eventfd, initval);
> +  /* eventfd2 uses FLAGS but eventfd doesn't take FLAGS. */
> +#if defined (__NR_eventfd)
> +    return syscall(__NR_eventfd, initval);
> +#else
> +    errno = ENOSYS;
> +    return -1;
> +#endif
>  }
> 
>  /*
> @@ -512,7 +520,7 @@ child_inherit_test(int fd)
>       }
>  }
> 
> -#ifdef HAS_AIO_EVENTFD
> +#ifdef HAVE_IO_SET_EVENTFD
>  /*
>   * Test whether counter overflow is detected and handled correctly. 
>   *
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> 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

Reply via email to