source: rtems/cpukit/posix/src/mqueue.c @ c8982e5

5
Last change on this file since c8982e5 was c8982e5, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 26, 2016 at 7:20:31 PM

posix: Simplify message queues

The mq_open() function returns a descriptor to a POSIX message queue
object identified by a name. This is similar to sem_open(). In
contrast to the POSIX semaphore the POSIX message queues use a separate
object for the descriptor. This extra object is superfluous, since the
object identifier can be used directly for this purpose, just like for
the semaphores.

Update #2702.
Update #2555.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initializes message_queue Manager Related Data Structures
5 * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <stdarg.h>
22
23#include <pthread.h>
24#include <errno.h>
25#include <fcntl.h>
26#include <mqueue.h>
27#include <limits.h>
28
29#include <rtems/system.h>
30#include <rtems/config.h>
31#include <rtems/sysinit.h>
32#include <rtems/score/watchdog.h>
33#include <rtems/seterr.h>
34#include <rtems/posix/mqueueimpl.h>
35
36Objects_Information _POSIX_Message_queue_Information;
37
38Objects_Information _POSIX_Message_queue_Information_fds;
39
40/*
41 *  _POSIX_Message_queue_Manager_initialization
42 *
43 *  This routine initializes all message_queue manager related data structures.
44 *
45 *  Input parameters:   NONE
46 *
47 *  Output parameters:  NONE
48 */
49
50static void _POSIX_Message_queue_Manager_initialization(void)
51{
52  _Objects_Initialize_information(
53    &_POSIX_Message_queue_Information, /* object information table */
54    OBJECTS_POSIX_API,                 /* object API */
55    OBJECTS_POSIX_MESSAGE_QUEUES,      /* object class */
56    Configuration_POSIX_API.maximum_message_queues,
57                                /* maximum objects of this class */
58    sizeof( POSIX_Message_queue_Control ),
59                                /* size of this object's control block */
60    true,                       /* true if names for this object are strings */
61    _POSIX_PATH_MAX,            /* maximum length of each object's name */
62    NULL                        /* Proxy extraction support callout */
63  );
64}
65
66RTEMS_SYSINIT_ITEM(
67  _POSIX_Message_queue_Manager_initialization,
68  RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
69  RTEMS_SYSINIT_ORDER_MIDDLE
70);
Note: See TracBrowser for help on using the repository browser.