mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
To: K K <knewsgroup@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernelnewbies@kernelnewbies.org,
	adam.li@intel.com
Subject: Re: Does the mq_timedreceive() fully implement the POSIX specification?
Date: Tue, 14 Feb 2012 13:27:40 +0100	[thread overview]
Message-ID: <1329222461.25984.333.camel@thorin> (raw)
In-Reply-To: <CAEv6Xce7Xwgjfqs2E-3YvYryfSzvePBuBLEr8T_+6xQrjQ6XSA@mail.gmail.com>

Hi!

[ also Cc: the email address on the top on the test case. Therefore
self-quoting for the rest of the thread. ]

On Mon, 2012-02-13 at 09:51 +0100, Bernd Petrovitsch wrote:
> On Mon, 2012-02-13 at 10:30 +0800, K K wrote:
> [....]
> > I am doing POSIX test on linux. And for mq_timedreceive() in POSIX spec
> > 2008 Issue 7, Line 43787:
> > 
> >   The validity of the abstime parameter need not be checked if a
> >   message can be removed from the message queue immediately.
> > 
> > But when I run test case mq_timedreceive/10-2 of POSIX suite (can be viewed
> > at :
> > http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp.git;a=blob;f=testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c;h=49ee4f243fc5046a965a551650d8697217faac35;hb=HEAD),
> > mq_timedreceive() could get the message without wait, but the timeout is
> > still validated.
> > 
> > Do we intend to do so, or the implementation needs update?
> 
> I'm not a native English speaker but there is IMHO no problem as the
> above quoted part of POSIX simply does not require the check in that
> case. But it doesn't forbid the check.

On Die, 2012-02-14 at 14:44 +0800, K K wrote:
[...]
> Under no circumstance shall the operation fail with a timeout if a message
> can be removed from
> the message queue immediately. The validity of the abstime parameter need
> not be checked if a
> message can be removed from the message queue immediately.
> 
> It seems that the first sentence is more affirmative that the timeout
> should not be checked when a message can be removed from message queue
> immediately.
> How do you think?

Well, and the sys-call actually does not fail with a *timeout* - which
is indicated with a return value == -1 and errno == ETIMEDOUT if I read
http://pubs.opengroup.org/onlinepubs/009695399/functions/mq_receive.html
correctly - but with some another error - return value == -1 and errno
== EINVAL.
So the first quoted sentence actually doesn't apply IMHO.

The test description in the second comment on 
http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp.git;a=blob;f=testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c;h=49ee4f243fc5046a965a551650d8697217faac35;hb=HEAD
reparaphrases the above quoted part incorrectly IMHO. The test
implements the description at the top though.


	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@petrovitsch.priv.at
                     LUGA : http://www.luga.at


      parent reply	other threads:[~2012-02-14 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEv6XcdzB++iZX4qAzmQYCJwfspXAHB01qEQoS+G2+8F+bm5Zg@mail.gmail.com>
2012-02-13  8:51 ` Bernd Petrovitsch
     [not found]   ` <CAEv6XceZQibb7srVDHYcDDHLUuDL4HS8xu7FqOa45Cp3OujbpQ@mail.gmail.com>
     [not found]     ` <CAEv6Xce7Xwgjfqs2E-3YvYryfSzvePBuBLEr8T_+6xQrjQ6XSA@mail.gmail.com>
2012-02-14 12:27       ` Bernd Petrovitsch [this message]

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=1329222461.25984.333.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=adam.li@intel.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=knewsgroup@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome