Subrata Modak wrote:
On Mon, 2008-05-19 at 19:26 +0800, Roy Lee wrote:
2008/5/19, Subrata Modak <[EMAIL PROTECTED]>:

Well this breaks my compilation even on a i386 system. See the
compilation error:

cc -Wall  -I../../include -g -Wall -I../lib -I../../../../../include
-Wall    shmat01.c  -L../../../../../lib -lltp -L.. -lipc -o shmat01
shmat01.c:84: error: initializer element is not constant
shmat01.c:84: error: (near initialization for 'TC[1].offset')
shmat01.c: In function 'setup':
shmat01.c:259: warning: comparison between pointer and integer
make[5]: *** [shmat01] Error 1

Oops, I forgot that some architectures define their SHMLBA as getpagesize(),
which may be implemented as a function and cannot be used to
initialize static data.

Could you try this one?  Thanks.

Thanks. This builds fine now. Committed to CVS.

Hello Subrata,
Hello Roy,

this patch broke parisc (which has really some strange requirements).
Attached patch fixes it. If it's OK for you, please apply.

Helge

Index: shmat01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c,v
retrieving revision 1.10
diff -u -p -r1.10 shmat01.c
--- shmat01.c	19 May 2008 11:58:42 -0000	1.10
+++ shmat01.c	19 May 2008 22:17:52 -0000
@@ -280,6 +280,10 @@ setup(void)
 		tst_brkm(TBROK, cleanup,
 				"Couldn't detach shared memory");
 	}
+
+	/* some architectures (e.g. parisc) are strange, so better always align to
+	 * next SHMLBA address. */
+	base_addr = (void *)( ((unsigned long)(base_addr) & ~(SHMLBA-1)) + SHMLBA );
 }
 
 /*
Index: shmat02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c,v
retrieving revision 1.8
diff -u -p -r1.8 shmat02.c
--- shmat02.c	19 May 2008 11:58:42 -0000	1.8
+++ shmat02.c	19 May 2008 22:17:52 -0000
@@ -226,6 +226,10 @@ setup(void)
 		tst_brkm(TBROK, cleanup,
 				"Couldn't detach shared memory");
 	}
+
+	/* some architectures (e.g. parisc) are strange, so better always align to
+	 * next SHMLBA address. */
+	base_addr = (void *)( ((unsigned long)(base_addr) & ~(SHMLBA-1)) + SHMLBA );
 }
 
 /*
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to