source: rtems/cpukit/posix/src/mqueuetranslatereturncode.c @ 864ac98

4.104.114.84.95
Last change on this file since 864ac98 was 864ac98, checked in by Jennifer Averett <Jennifer.Averett@…>, on 01/05/00 at 17:06:45

Added routines to translate to and from the core message queue return codes.

  • Property mode set to 100644
File size: 1.8 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.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <pthread.h>
16#include <limits.h>
17#include <errno.h>
18#include <fcntl.h>
19#include <mqueue.h>
20
21#include <rtems/system.h>
22#include <rtems/score/watchdog.h>
23#include <rtems/posix/seterr.h>
24#include <rtems/posix/mqueue.h>
25#include <rtems/posix/time.h>
26
27
28/*PAGE
29 *
30 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
31 *
32 *  Input parameters:
33 *    the_message_queue_status - message_queue status code to translate
34 *
35 *  Output parameters:
36 *    rtems status code - translated POSIX status code
37 *
38 */
39 
40int _POSIX_Message_queue_Translate_core_message_queue_return_code(
41  unsigned32 the_message_queue_status
42)
43{
44  switch ( the_message_queue_status ) {
45    case  CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
46      return 0;
47    case  CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
48      return EMSGSIZE;
49    case  CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
50      return EAGAIN;
51    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
52      return ENOSYS;                  /* XXX */
53    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
54      return ENOSYS;                  /* XXX */
55    case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
56      return EBADF;
57    case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
58      return ENOSYS;                  /* XXX */
59    case THREAD_STATUS_PROXY_BLOCKING:
60      return ENOSYS;                  /* XXX */
61  }
62  _Internal_error_Occurred(         /* XXX */
63    INTERNAL_ERROR_POSIX_API,
64    TRUE,
65    the_message_queue_status
66  );
67  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
68}
Note: See TracBrowser for help on using the repository browser.