public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] pidns31: fix EACCESS error in mq_open()
Date: Mon, 16 Aug 2010 20:22:21 +0530	[thread overview]
Message-ID: <1281970341.5120.18.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <20100805014358.GA14122@us.ibm.com>


On Wed, 2010-08-04 at 18:43 -0700, Sukadev Bhattiprolu wrote: 
> Garrett Cooper [yanegomi@gmail.com] wrote:
> | On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
> | <sukadev@linux.vnet.ibm.com> wrote:
> | >
> | > 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)",
> | 
> | Did Linux become non-POSIX compliant :) (from
> | <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?
> 
> Heh. Good question but I think the mq_open() from glibc is compliant
> with this. I am just not sure if the call via syscall() needs to be
> compliant.
> 
> But if that is a concern, we need a separate a test case for that -
> pidns31 is using mq_* to test an unrelated feature. I think would
> make sense to apply this fix, allowing LTP to test the feature even
> on older distros.
> 
> Or pidns31 can go back to using the library interface and we could
> skip the test on old distros.

I would prefer this.

Regards--
Subrata

> 
> Sukadev.


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2010-08-16 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=1281970341.5120.18.camel@subratamodak.linux.ibm.com \
    --to=subrata@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=sukadev@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