This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Better POSIX compliance for mq_timedsend(), mq_timedreceived()
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Rickard Westman <rickard dot westman at 27m dot se>
- Cc: ecos-patches at sources dot redhat dot com
- Date: 21 Nov 2003 10:56:23 +0000
- Subject: Re: Better POSIX compliance for mq_timedsend(), mq_timedreceived()
- References: <3FBAA53B.5070106@27m.se>
Rickard Westman <rickard.westman@27m.se> writes:
> Hi,
>
> The attached patch attempts to correct a problem with mq_timedsend() and
> mq_timedreceived() when used with very short timeouts. According to POSIX:
>
> mq_timedsend(): "Under no circumstance shall the operation fail with a
> timeout if there is sufficient room in the queue to add the message
> immediately."
>
> mq_timedreceive(): "Under no circumstance shall the operation fail with
> a timeout if a message can be removed from the message queue immediately."
>
> However, the eCos implementation (2.0) seems to time out whenever it
> can, regardless of whether the operation could actually be performed at
> the time. (I noticed this when I tried to use an abstime equivalent to
> a zero timeout, in order to achieve a one-shot non-blocking operation
> without actually changing the mode of the queue.)
I've now committed this patch.
For future reference, we like patch submitters to provide a ChangeLog
entry. I've written one for you this time, I may not be so generous in
future :-)
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts