From e38cb52d2d9544db77bbae4619ec15e0ee0d0b86 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Wed, 12 Jan 2000 18:47:22 +0000 Subject: Debugged and yellow line tested routines. --- cpukit/posix/src/mqueuetranslatereturncode.c | 38 ++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'cpukit/posix/src/mqueuetranslatereturncode.c') diff --git a/cpukit/posix/src/mqueuetranslatereturncode.c b/cpukit/posix/src/mqueuetranslatereturncode.c index 2cdb4ab9b0..edc5e2954d 100644 --- a/cpukit/posix/src/mqueuetranslatereturncode.c +++ b/cpukit/posix/src/mqueuetranslatereturncode.c @@ -44,22 +44,50 @@ int _POSIX_Message_queue_Translate_core_message_queue_return_code( switch ( the_message_queue_status ) { case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL: return 0; + + /* + * Bad message size + */ case CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE: return EMSGSIZE; + + /* + * Queue is full of pending messages. + */ case CORE_MESSAGE_QUEUE_STATUS_TOO_MANY: return EAGAIN; + + /* + * Out of message buffers to queue pending message + */ case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED: - return ENOSYS; /* XXX */ + return ENOMEM; + + /* + * No message available on receive poll + */ case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT: - return ENOSYS; /* XXX */ + return EAGAIN; + + /* + * Queue was deleted while thread blocked on it. + */ case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED: return EBADF; + + /* + * POSIX Real-Time Extensions add timeouts to send and receive. + */ case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT: - return ENOSYS; /* XXX */ + return ETIMEDOUT; + + /* + * RTEMS POSIX API implementation does not support multiprocessing. + */ case THREAD_STATUS_PROXY_BLOCKING: - return ENOSYS; /* XXX */ + return ENOSYS; } - _Internal_error_Occurred( /* XXX */ + _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, TRUE, the_message_queue_status -- cgit v1.2.3