Changeset e2255453 in rtems


Ignore:
Timestamp:
01/19/20 15:11:38 (4 years ago)
Author:
Martin Erik Werner <martinerikwerner@…>
Branches:
5, master
Children:
26443da
Parents:
ebf0f8f
git-author:
Martin Erik Werner <martinerikwerner@…> (01/19/20 15:11:38)
git-committer:
Joel Sherrill <joel@…> (01/24/20 14:01:22)
Message:

Use EAGAIN for POSIX mq wait in ISR error

Modify the status code returned by _CORE_message_queue_Submit() when it
detects a wait about to happen in an ISR (which would be deadly) to
return a status which translated to EAGAIN instead of ENOMEM.

This is only relevant for POSIX message queues, since Classic API message
queues cannot block on send.

The motivation is to match the "most related" errno value returned from
mq_send() and mq_timedsend() according to POSIX, via Open Group:

[EAGAIN]

The O_NONBLOCK flag is set in the message queue description
associated with mqdes, and the specified message queue is full.

or via the RTEMS POSIX users documentation

EAGAIN

The message queue is non-blocking, and there is no room on the queue
for another message as specified by the mq_maxmsg.

Neither of these matches the case ofi avoided ISR wait perfectly, but
they seem to be the closest equivalent, unless it is desirable to keep a
new non-standard error for this case. It is presumed that this is not
desirable.

The previously returned ENOMEM error value is not documented in either
the Open Group or the RTEMS POSIX uses documentation. A companion patch
corrects the documentation to include this error condition.

Based on the discussion in:
https://lists.rtems.org/pipermail/devel/2020-January/056891.html

closes #3857.

Message-Id: <CAF9ehCW5P12ZkZja4UPYTbdBFUyC1VKVL-tU7nyUtvK1Lz2Z3g@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/status.h

    rebf0f8f re2255453  
    9191    STATUS_BUILD( STATUS_CLASSIC_INVALID_SIZE, EMSGSIZE ),
    9292  STATUS_MESSAGE_QUEUE_WAIT_IN_ISR =
    93     STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, ENOMEM ),
     93    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EAGAIN ),
    9494  STATUS_MESSAGE_QUEUE_WAS_DELETED =
    9595    STATUS_BUILD( STATUS_CLASSIC_OBJECT_WAS_DELETED, EBADF ),
Note: See TracChangeset for help on using the changeset viewer.