source: rtems/cpukit/posix/src/mqueuetranslatereturncode.c @ 39cefdd

4.104.114.84.95
Last change on this file since 39cefdd was 39cefdd, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/23/04 at 13:07:29

2004-03-23 Ralf Corsepius <ralf_corsepius@…>

  • posix/include/rtems/posix/cond.h, posix/include/rtems/posix/intr.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/threadsup.h, posix/include/rtems/posix/timer.h, posix/src/cond.c, posix/src/intr.c, posix/src/key.c, posix/src/keycreate.c, posix/src/keydelete.c, posix/src/keygetspecific.c, posix/src/keyrundestructors.c, posix/src/keysetspecific.c, posix/src/killinfo.c, posix/src/mqueue.c, posix/src/mqueuerecvsupp.c, posix/src/mqueuesendsupp.c, posix/src/mqueuetranslatereturncode.c, posix/src/mutex.c, posix/src/posixintervaltotimespec.c, posix/src/posixtimespecsubtract.c, posix/src/psignal.c, posix/src/pthread.c, posix/src/ptimer1.c, posix/src/semaphore.c, posix/src/sysconf.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  POSIX Message Queue Error Translation
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <pthread.h>
20#include <limits.h>
21#include <errno.h>
22#include <fcntl.h>
23#include <mqueue.h>
24
25#include <rtems/system.h>
26#include <rtems/score/watchdog.h>
27#include <rtems/seterr.h>
28#include <rtems/posix/mqueue.h>
29#include <rtems/posix/time.h>
30#include <rtems/score/interr.h>
31
32
33/*PAGE
34 *
35 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
36 *
37 *  Input parameters:
38 *    the_message_queue_status - message_queue status code to translate
39 *
40 *  Output parameters:
41 *    rtems status code - translated POSIX status code
42 *
43 */
44 
45int _POSIX_Message_queue_Translate_core_message_queue_return_code(
46  uint32_t   the_message_queue_status
47)
48{
49  switch ( the_message_queue_status ) {
50    case  CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
51      return 0;
52
53      /*
54       *  Bad message size
55       */
56    case  CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
57      return EMSGSIZE;
58
59      /*
60       *  Queue is full of pending messages.
61       */
62    case  CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
63      return EAGAIN;
64
65      /*
66       *  Out of message buffers to queue pending message
67       */
68    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
69      return ENOMEM;
70
71      /*
72       *  No message available on receive poll
73       */
74    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
75      return EAGAIN;
76
77      /*
78       *  Queue was deleted while thread blocked on it.
79       */
80    case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
81      return EBADF;
82
83      /*
84       *  POSIX Real-Time Extensions add timeouts to send and receive.
85       */
86    case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
87      return ETIMEDOUT;
88
89      /*
90       *  RTEMS POSIX API implementation does not support multiprocessing.
91       */
92    case THREAD_STATUS_PROXY_BLOCKING:
93      return ENOSYS;
94  }
95  _Internal_error_Occurred(
96    INTERNAL_ERROR_POSIX_API,
97    TRUE,
98    the_message_queue_status
99  );
100  return POSIX_BOTTOM_REACHED();
101}
Note: See TracBrowser for help on using the repository browser.