Thanks Andrew for providing this Fix. Here are the results below:

On the Machine where it was actually creating trouble building:

For: Linux 2.6.23.13 #1 SMP Wed Jan 9 18:14:28 PST 2008 ia64 GNU/Linux
# gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.


Prepatching:

cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
inotify01.c  -L../../../../lib -lltp -o inotify01
inotify01.c:53:25: error: sys/inotify.h: No such file or directory
inotify01.c:76: error: invalid application of 'sizeof' to incomplete
type 'struct inotify_event' 
inotify01.c: In function 'main':
inotify01.c:124: error: 'IN_ATTRIB' undeclared (first use in this
function)
inotify01.c:124: error: (Each undeclared identifier is reported only
once
inotify01.c:124: error: for each function it appears in.)
inotify01.c:132: error: 'IN_OPEN' undeclared (first use in this
function)
inotify01.c:140: error: 'IN_ACCESS' undeclared (first use in this
function)
inotify01.c:148: error: 'IN_CLOSE_NOWRITE' undeclared (first use in this
function)
inotify01.c:165: error: 'IN_MODIFY' undeclared (first use in this
function)
inotify01.c:173: error: 'IN_CLOSE_WRITE' undeclared (first use in this
function)
inotify01.c:186: error: invalid application of 'sizeof' to incomplete
type 'struct inotify_event' 
inotify01.c:189: error: invalid application of 'sizeof' to incomplete
type 'struct inotify_event' 
inotify01.c:204: error: dereferencing pointer to incomplete type
inotify01.c:204: error: dereferencing pointer to incomplete type
inotify01.c:205: error: dereferencing pointer to incomplete type
inotify01.c:205: error: dereferencing pointer to incomplete type
inotify01.c:206: error: dereferencing pointer to incomplete type
inotify01.c:209: error: dereferencing pointer to incomplete type
inotify01.c:209: error: dereferencing pointer to incomplete type
inotify01.c:210: error: dereferencing pointer to incomplete type
inotify01.c:210: error: dereferencing pointer to incomplete type
inotify01.c:215: error: dereferencing pointer to incomplete type
inotify01.c:215: error: dereferencing pointer to incomplete type
inotify01.c:217: error: dereferencing pointer to incomplete type
inotify01.c:217: error: dereferencing pointer to incomplete type
inotify01.c:220: error: invalid application of 'sizeof' to incomplete
type 'struct inotify_event' 
inotify01.c:220: error: dereferencing pointer to incomplete type
inotify01.c: In function 'setup':
inotify01.c:281: error: 'IN_ALL_EVENTS' undeclared (first use in this
function)
make[4]: *** [inotify01] Error 1

Post Patching:
Successfull Build & Install:

Run Results:
# ./testcases/bin/inotify01
inotify01    1  BROK  :  can't find header sys/inotify.h
# ./testcases/bin/inotify02
inotify02    1  BROK  :  can't find header sys/inotify.h


For other architectures as well, it works fine. But i see some failures
even pre and post patching in the following machine:
Linux 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386
GNU/Linux
$ gcc --version
gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
Copyright (C) 2006 Free Software Foundation, Inc.


Could you also investigate the failures as well. They are same both pre
and post patching:

]# ./testcases/bin/inotify01 
inotify01    1  PASS  :  get event: wd=1 mask=4 cookie=0 len=0
inotify01    2  PASS  :  get event: wd=1 mask=20 cookie=0 len=0
inotify01    3  PASS  :  get event: wd=1 mask=1 cookie=0 len=0
inotify01    4  PASS  :  get event: wd=1 mask=10 cookie=0 len=0
inotify01    5  PASS  :  get event: wd=1 mask=20 cookie=0 len=0
inotify01    6  PASS  :  get event: wd=1 mask=2 cookie=0 len=0
inotify01    7  FAIL  :  get event: wd=1 mask=20 (expected 8) cookie=0
len=0
inotify01    8  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01    9  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   10  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   11  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   12  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   13  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   14  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   15  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   16  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   17  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   18  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   19  FAIL  :  get unnecessary event: wd=1 mask=1 cookie=0
len=0
inotify01   20  FAIL  :  get unnecessary event: wd=1 mask=10 cookie=0
len=0
inotify01   21  FAIL  :  get unnecessary event: wd=1 mask=8 cookie=0
len=0

# ./testcases/bin/inotify02 
inotify02    1  PASS  :  get event: wd=1 mask=40000004 cookie=0 len=0
name=""
inotify02    2  PASS  :  get event: wd=1 mask=100 cookie=0 len=16
name="test_file1"
inotify02    3  PASS  :  get event: wd=1 mask=20 cookie=0 len=16
name="test_file1"
inotify02    4  FAIL  :  get event: wd=1 mask=20 (expected 8) cookie=0
len=16 name="test_file1" (expected "test_file1") 0
inotify02    5  FAIL  :  get event: wd=1 mask=10 (expected 40) cookie=0
len=16 name="test_file1" (expected "test_file1") 0
inotify02    6  FAIL  :  get event: wd=1 mask=8 (expected 80) cookie=0
len=16 name="test_file1" (expected "test_file2") 1
inotify02    7  FAIL  :  get event: wd=1 mask=40 (expected 800)
cookie=6472 len=16 name="test_file1" (expected "") -1
inotify02    8  FAIL  :  get event: wd=1 mask=80 (expected 200)
cookie=6472 len=16 name="test_file2" (expected "test_file2") 0
inotify02    9  PASS  :  get event: wd=1 mask=800 cookie=0 len=0
name=""
inotify02   10  FAIL  :  get unnecessary event: wd=1 mask=200 cookie=0
len=16name="test_file2"
inotify02   11  FAIL  :  get unnecessary event: wd=1 mask=800 cookie=0
len=0name=""
inotify02   12  FAIL  :  get unnecessary event: wd=1 mask=800 cookie=0
len=0name=""

Since the Patch provides fix or the actual build issue(s), i have merged
them.

Meanwhile there is another test which fails only on this machine, may
something to do with the headers as well. Can you also look in to this:

cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
-I../../../../include -Wall    utimensat01.c  -L../../../../lib -lltp -o
utimensat01
utimensat01.c: In function 'main':
utimensat01.c:115: error: 'AT_FDCWD' undeclared (first use in this
function)
utimensat01.c:115: error: (Each undeclared identifier is reported only
once
utimensat01.c:115: error: for each function it appears in.)
utimensat01.c:126: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in
this function)
make[5]: *** [utimensat01] Error 1

Regards--
Subrata

On Wed, 2008-08-27 at 18:57 +0400, Andrew Vagin wrote:
> that we don't break builds.
> ---
>  testcases/kernel/syscalls/inotify/Makefile    |    7 +++++++
>  testcases/kernel/syscalls/inotify/inotify01.c |    9 +++++++--
>  testcases/kernel/syscalls/inotify/inotify02.c |    9 +++++++--
>  3 files changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/inotify/Makefile 
> b/testcases/kernel/syscalls/inotify/Makefile
> index 73eb227..3ed0fa9 100644
> --- a/testcases/kernel/syscalls/inotify/Makefile
> +++ b/testcases/kernel/syscalls/inotify/Makefile
> @@ -21,6 +21,13 @@ LDLIBS += -L../../../../lib -lltp
> 
>  SRCS    = $(wildcard *.c)
>  TARGETS = $(patsubst %.c,%,$(SRCS))
> +check_header = $(shell \
> +                     if echo "\#include <$(1)>" | $(CC) -E - > /dev/null; \
> +                     then echo -DHAS_SYS_INOTIFY ; \
> +                     fi)
> +
> +HAS_SYS_INOTIFY := $(call check_header,sys/inotify.h)
> +CFLAGS += $(HAS_SYS_INOTIFY)
> 
>  all: $(TARGETS)
> 
> diff --git a/testcases/kernel/syscalls/inotify/inotify01.c 
> b/testcases/kernel/syscalls/inotify/inotify01.c
> index a1502f1..055e993 100644
> --- a/testcases/kernel/syscalls/inotify/inotify01.c
> +++ b/testcases/kernel/syscalls/inotify/inotify01.c
> @@ -49,7 +49,7 @@
>  #include "test.h"
>  #include "usctest.h"
> 
> -#ifdef __NR_inotify_init
> +#if defined(HAS_SYS_INOTIFY) && defined(__NR_inotify_init)
>  #include <sys/inotify.h>
> 
>  #define EVENT_MAX 1024
> @@ -327,9 +327,14 @@ int TST_TOTAL = 0;              /* Total number of test 
> cases. */
>  int
>  main()
>  {
> +#ifndef __NR_inotify_init
>      tst_resm(TWARN, "This test needs a kernel that has inotify syscall.");
>      tst_resm(TWARN, "Inotify syscall can be found at kernel 2.6.13 or 
> higher.");
> -    exit(0);
> +#endif
> +#ifndef HAS_SYS_INOTIFY:
> +    tst_resm(TBROK, "can't find header sys/inotify.h");
> +    return 1;
> +#endif
>      return 0;
>  }
> 
> diff --git a/testcases/kernel/syscalls/inotify/inotify02.c 
> b/testcases/kernel/syscalls/inotify/inotify02.c
> index d7dc83f..b879b62 100644
> --- a/testcases/kernel/syscalls/inotify/inotify02.c
> +++ b/testcases/kernel/syscalls/inotify/inotify02.c
> @@ -52,7 +52,7 @@
>  #include "test.h"
>  #include "usctest.h"
> 
> -#ifdef __NR_inotify_init
> +#if defined(__NR_inotify_init) && defined(HAS_SYS_INOTIFY)
>  #include <sys/inotify.h>
> 
>  #ifndef IN_MOVE_SELF
> @@ -368,9 +368,14 @@ int TST_TOTAL = 0;              /* Total number of test 
> cases. */
>  int
>  main()
>  {
> +#ifndef __NR_inotify_init
>      tst_resm(TWARN, "This test needs a kernel that has inotify syscall.");
>      tst_resm(TWARN, "Inotify syscall can be found at kernel 2.6.13 or 
> higher.");
> -    exit(0);
> +#endif
> +#ifndef HAS_SYS_INOTIFY:
> +    tst_resm(TBROK, "can't find header sys/inotify.h");
> +    return 1;
> +#endif
>      return 0;
>  }
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to