public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] pidns31: fix EACCESS error in mq_open()
@ 2010-08-04 23:52 Sukadev Bhattiprolu
  2010-08-05  0:40 ` Garrett Cooper
  0 siblings, 1 reply; 9+ messages in thread
From: Sukadev Bhattiprolu @ 2010-08-04 23:52 UTC (permalink / raw)
  To: subrata; +Cc: ltp-list


pidns31: mq_open() fails with EACCESS.

pidns31 test case fails with EACCESS - due to the leading '/' in
mqname. See comments in the patch below for details.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
Index: testcases/kernel/containers/pidns/pidns31.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
retrieving revision 1.6
diff -u -p -r1.6 pidns31.c
--- testcases/kernel/containers/pidns/pidns31.c	14 Nov 2009 23:58:26 -0000	1.6
+++ testcases/kernel/containers/pidns/pidns31.c	4 Aug 2010 23:24:54 -0000
@@ -61,7 +61,14 @@
 char *TCID = "pidns31";
 int TST_TOTAL = 1;
 
-char *mqname = "/mq1";
+
+/*
+ * NOTE: The mq_open() interface in glibc requires mqname to start with a '/' 
+ * 	 and the glibc call skips the leading '/' when invoking the system
+ * 	 call. Since we bypass the glibc mq_open() (and use syscall()) we
+ * 	 define mqname without the leading '/'.
+ */
+char *mqname = "mq1";
 int result = TFAIL;
 
 int errno;
@@ -264,6 +271,7 @@ int main(int argc, char *argv[])
 	}
 
 	syscall(__NR_mq_unlink, mqname);
+
 	mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
 	if (mqd == (mqd_t)-1) {
 		tst_resm(TBROK, "parent: mq_open() failed (%s)",

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2010-11-11  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-04 23:52 [LTP] pidns31: fix EACCESS error in mq_open() Sukadev Bhattiprolu
2010-08-05  0:40 ` Garrett Cooper
2010-08-05  1:43   ` Sukadev Bhattiprolu
2010-08-16 14:52     ` Subrata Modak
2010-08-16 23:01       ` Garrett Cooper
2010-08-24 11:02         ` Subrata Modak
2010-10-28  5:22         ` Sukadev Bhattiprolu
2010-11-11  7:57           ` Subrata Modak
2010-11-11  8:40             ` Garrett Cooper

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