<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-12-13)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-12-13 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * posix/src/mqueuenametoid.c,
        posix/src/semaphorenametoid.c: Removed files.
        * posix/src/psxnametoid.c: New file.
        * posix/Makefile.am: Reflect changes above.
        * posix/include/rtems/posix/config.h: Fixed integer types.
        * posix/include/rtems/posix/posixapi.h: Declare _POSIX_Name_to_id().
        * posix/include/rtems/posix/mqueue.h,
        posix/inline/rtems/posix/mqueue.inl: Changed parameter of
        _POSIX_Message_queue_Create_support().
        _POSIX_Message_queue_Name_to_id() is now inline.
        * posix/include/rtems/posix/semaphore.h,
        posix/inline/rtems/posix/semaphore.inl: Changed parameter of
        _POSIX_Semaphore_Create_support().  _POSIX_Semaphore_Name_to_id() is
        now inline.
        * posix/src/mqueuecreatesupp.c, posix/src/semaphorecreatesupp.c: Use
        _Workspace_String_duplicate().
        * posix/src/mqueuesendsupp.c, posix/src/mqueueopen.c,
        posix/src/mqueueunlink.c, posix/src/seminit.c, posix/src/semopen.c,
        posix/src/semunlink.c: Update due to API changes.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.3089&r2=text&tr2=1.3090&diff_format=h">M</a></td><td width='1%'>1.3090</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/Makefile.am.diff?r1=text&tr1=1.91&r2=text&tr2=1.92&diff_format=h">M</a></td><td width='1%'>1.92</td><td width='100%'>cpukit/posix/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/include/rtems/posix/config.h.diff?r1=text&tr1=1.22&r2=text&tr2=1.23&diff_format=h">M</a></td><td width='1%'>1.23</td><td width='100%'>cpukit/posix/include/rtems/posix/config.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/include/rtems/posix/mqueue.h.diff?r1=text&tr1=1.31&r2=text&tr2=1.32&diff_format=h">M</a></td><td width='1%'>1.32</td><td width='100%'>cpukit/posix/include/rtems/posix/mqueue.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/include/rtems/posix/posixapi.h.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>cpukit/posix/include/rtems/posix/posixapi.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/include/rtems/posix/semaphore.h.diff?r1=text&tr1=1.28&r2=text&tr2=1.29&diff_format=h">M</a></td><td width='1%'>1.29</td><td width='100%'>cpukit/posix/include/rtems/posix/semaphore.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/inline/rtems/posix/mqueue.inl.diff?r1=text&tr1=1.19&r2=text&tr2=1.20&diff_format=h">M</a></td><td width='1%'>1.20</td><td width='100%'>cpukit/posix/inline/rtems/posix/mqueue.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/inline/rtems/posix/semaphore.inl.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>cpukit/posix/inline/rtems/posix/semaphore.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/mqueuecreatesupp.c.diff?r1=text&tr1=1.23&r2=text&tr2=1.24&diff_format=h">M</a></td><td width='1%'>1.24</td><td width='100%'>cpukit/posix/src/mqueuecreatesupp.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/mqueuenametoid.c?rev=1.13&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.13</font></td><td width='100%'><font color="#880000">cpukit/posix/src/mqueuenametoid.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/mqueueopen.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>cpukit/posix/src/mqueueopen.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/mqueuesendsupp.c.diff?r1=text&tr1=1.23&r2=text&tr2=1.24&diff_format=h">M</a></td><td width='1%'>1.24</td><td width='100%'>cpukit/posix/src/mqueuesendsupp.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/mqueueunlink.c.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>cpukit/posix/src/mqueueunlink.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psxnametoid.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/posix/src/psxnametoid.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/semaphorecreatesupp.c.diff?r1=text&tr1=1.16&r2=text&tr2=1.17&diff_format=h">M</a></td><td width='1%'>1.17</td><td width='100%'>cpukit/posix/src/semaphorecreatesupp.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/semaphorenametoid.c?rev=1.14&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.14</font></td><td width='100%'><font color="#880000">cpukit/posix/src/semaphorenametoid.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/seminit.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/posix/src/seminit.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/semopen.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>cpukit/posix/src/semopen.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/semunlink.c.diff?r1=text&tr1=1.15&r2=text&tr2=1.16&diff_format=h">M</a></td><td width='1%'>1.16</td><td width='100%'>cpukit/posix/src/semunlink.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.3089 rtems/cpukit/ChangeLog:1.3090
--- rtems/cpukit/ChangeLog:1.3089       Tue Dec 13 04:52:19 2011
+++ rtems/cpukit/ChangeLog      Tue Dec 13 06:56:52 2011
</font><font color='#997700'>@@ -1,5 +1,27 @@
</font> 2011-12-13        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
<font color='#000088'>+   * posix/src/mqueuenametoid.c,
+       posix/src/semaphorenametoid.c: Removed files.
+       * posix/src/psxnametoid.c: New file.
+       * posix/Makefile.am: Reflect changes above.
+       * posix/include/rtems/posix/config.h: Fixed integer types.
+       * posix/include/rtems/posix/posixapi.h: Declare _POSIX_Name_to_id().
+       * posix/include/rtems/posix/mqueue.h,
+       posix/inline/rtems/posix/mqueue.inl: Changed parameter of
+       _POSIX_Message_queue_Create_support().
+       _POSIX_Message_queue_Name_to_id() is now inline.
+       * posix/include/rtems/posix/semaphore.h,
+       posix/inline/rtems/posix/semaphore.inl: Changed parameter of
+       _POSIX_Semaphore_Create_support().  _POSIX_Semaphore_Name_to_id() is
+       now inline.
+       * posix/src/mqueuecreatesupp.c, posix/src/semaphorecreatesupp.c: Use
+       _Workspace_String_duplicate().
+       * posix/src/mqueuesendsupp.c, posix/src/mqueueopen.c,
+       posix/src/mqueueunlink.c, posix/src/seminit.c, posix/src/semopen.c,
+       posix/src/semunlink.c: Update due to API changes.
+
+2011-12-13     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
</font>   * sapi/include/confdefs.h: Fixed workspace size estimate of POSIX keys
        and message queues.
 

<font color='#006600'>diff -u rtems/cpukit/posix/Makefile.am:1.91 rtems/cpukit/posix/Makefile.am:1.92
--- rtems/cpukit/posix/Makefile.am:1.91 Thu Dec  8 02:57:57 2011
+++ rtems/cpukit/posix/Makefile.am      Tue Dec 13 06:56:52 2011
</font><font color='#997700'>@@ -106,7 +106,7 @@
</font> ## MESSAGE_QUEUE_C_FILES
 libposix_a_SOURCES += src/mqueue.c src/mqueueclose.c \
     src/mqueuecreatesupp.c src/mqueuedeletesupp.c src/mqueuegetattr.c \
<font color='#880000'>-    src/mqueuenametoid.c src/mqueuenotify.c src/mqueueopen.c \
</font><font color='#000088'>+    src/mqueuenotify.c src/mqueueopen.c \
</font>     src/mqueuereceive.c src/mqueuerecvsupp.c src/mqueuesend.c \
     src/mqueuesendsupp.c src/mqueuesetattr.c src/mqueuetimedreceive.c \
     src/mqueuetimedsend.c src/mqueuetranslatereturncode.c \
<font color='#997700'>@@ -170,7 +170,7 @@
</font> 
 ## SEMAPHORE_C_FILES
 libposix_a_SOURCES += src/semaphore.c src/semaphorecreatesupp.c \
<font color='#880000'>-    src/semaphoredeletesupp.c src/semaphorenametoid.c \
</font><font color='#000088'>+    src/semaphoredeletesupp.c \
</font>     src/semaphoretranslatereturncode.c src/semaphorewaitsupp.c \
     src/semclose.c src/semdestroy.c src/semgetvalue.c src/seminit.c \
     src/semopen.c src/sempost.c src/semtimedwait.c src/semtrywait.c \
<font color='#997700'>@@ -195,6 +195,7 @@
</font> 
 ## SUPPORT_C_FILES
 libposix_a_SOURCES += src/psxpriorityisvalid.c
<font color='#000088'>+libposix_a_SOURCES += src/psxnametoid.c
</font> 
 EXTRA_DIST += src/README.mqueue
 

<font color='#006600'>diff -u rtems/cpukit/posix/include/rtems/posix/config.h:1.22 rtems/cpukit/posix/include/rtems/posix/config.h:1.23
--- rtems/cpukit/posix/include/rtems/posix/config.h:1.22        Fri Jun 24 12:52:56 2011
+++ rtems/cpukit/posix/include/rtems/posix/config.h     Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -45,19 +45,19 @@
</font> } posix_initialization_threads_table;
 
 typedef struct {
<font color='#880000'>-  int                                 maximum_threads;
-  int                                 maximum_mutexes;
-  int                                 maximum_condition_variables;
-  int                                 maximum_keys;
-  int                                 maximum_timers;
-  int                                 maximum_queued_signals;
-  int                                 maximum_message_queues;
-  int                                 maximum_message_queue_descriptors;
-  int                                 maximum_semaphores;
-  int                                 maximum_barriers;
-  int                                 maximum_rwlocks;
-  int                                 maximum_spinlocks;
-  int                                 number_of_initialization_threads;
</font><font color='#000088'>+  uint32_t                            maximum_threads;
+  uint32_t                            maximum_mutexes;
+  uint32_t                            maximum_condition_variables;
+  uint32_t                            maximum_keys;
+  uint32_t                            maximum_timers;
+  uint32_t                            maximum_queued_signals;
+  uint32_t                            maximum_message_queues;
+  uint32_t                            maximum_message_queue_descriptors;
+  uint32_t                            maximum_semaphores;
+  uint32_t                            maximum_barriers;
+  uint32_t                            maximum_rwlocks;
+  uint32_t                            maximum_spinlocks;
+  uint32_t                            number_of_initialization_threads;
</font>   posix_initialization_threads_table *User_initialization_threads_table;
 } posix_api_configuration_table;
 

<font color='#006600'>diff -u rtems/cpukit/posix/include/rtems/posix/mqueue.h:1.31 rtems/cpukit/posix/include/rtems/posix/mqueue.h:1.32
--- rtems/cpukit/posix/include/rtems/posix/mqueue.h:1.31        Sun Jul 24 18:55:06 2011
+++ rtems/cpukit/posix/include/rtems/posix/mqueue.h     Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <mqueue.h> /* struct mq_attr */
 #include <rtems/score/coremsg.h>
 #include <rtems/score/object.h>
<font color='#000088'>+#include <rtems/posix/posixapi.h>
</font> 
 #ifdef __cplusplus
 extern "C" {
<font color='#997700'>@@ -79,6 +80,7 @@
</font> 
 int _POSIX_Message_queue_Create_support(
   const char                    *name,
<font color='#000088'>+  size_t                         name_len,
</font>   int                            pshared,
   struct mq_attr                *attr,
   POSIX_Message_queue_Control  **message_queue
<font color='#997700'>@@ -126,7 +128,7 @@
</font>   mqd_t               mqdes,
   const char         *msg_ptr,
   size_t              msg_len,
<font color='#880000'>-  uint32_t            msg_prio,
</font><font color='#000088'>+  unsigned int        msg_prio,
</font>   bool                wait,
   Watchdog_Interval   timeout
 );
<font color='#997700'>@@ -187,20 +189,6 @@
</font> );
 
 /*
<font color='#880000'>- *  _POSIX_Message_queue_Name_to_id
- *
- *  DESCRIPTION:
- *
- *  This routine looks up the specified name for a message queue and returns the
- *  id of the message queue associated with it.
- */
-
-int _POSIX_Message_queue_Name_to_id(
-  const char          *name,
-  Objects_Id          *id
-);
-
-/*
</font>  *  _POSIX_Message_queue_Priority_to_core
  *
  *  DESCRIPTION:

<font color='#006600'>diff -u rtems/cpukit/posix/include/rtems/posix/posixapi.h:1.11 rtems/cpukit/posix/include/rtems/posix/posixapi.h:1.12
--- rtems/cpukit/posix/include/rtems/posix/posixapi.h:1.11      Fri Jun 24 12:52:56 2011
+++ rtems/cpukit/posix/include/rtems/posix/posixapi.h   Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -20,6 +20,7 @@
</font> #define _RTEMS_POSIX_POSIXAPI_H
 
 #include <rtems/config.h>
<font color='#000088'>+#include <rtems/score/object.h>
</font> 
 /**
  *  @brief Initialize POSIX API
<font color='#997700'>@@ -29,5 +30,27 @@
</font>  */
 void _POSIX_API_Initialize(void);
 
<font color='#000088'>+/**
+ *  @brief Queries the object identifier @a id for a @a name.
+ *
+ *  @param[in] information Object information.
+ *  @param[in] name Zero terminated name string to look up.
+ *  @param[out] id Pointer for identifier.  The pointer must be valid.
+ *  @param[out] len Pointer for string length.  The pointer must be valid.
+ *
+ *  @retval 0 Successful operation.
+ *  @retval EINVAL The @a name pointer is @c NULL or the @a name string has
+ *  zero length.
+ *  @retval ENAMETOOLONG The @a name string length is greater than or equal to
+ *  @c NAME_MAX.
+ *  @retval ENOENT Found no corresponding identifier.
+ */
+int _POSIX_Name_to_id(
+  Objects_Information *information,
+  const char          *name,
+  Objects_Id          *id,
+  size_t              *len
+);
+
</font> #endif
 /* end of include file */

<font color='#006600'>diff -u rtems/cpukit/posix/include/rtems/posix/semaphore.h:1.28 rtems/cpukit/posix/include/rtems/posix/semaphore.h:1.29
--- rtems/cpukit/posix/include/rtems/posix/semaphore.h:1.28     Fri Jun 24 12:52:57 2011
+++ rtems/cpukit/posix/include/rtems/posix/semaphore.h  Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -25,6 +25,7 @@
</font> 
 #include <semaphore.h>
 #include <rtems/score/coresem.h>
<font color='#000088'>+#include <rtems/posix/posixapi.h>
</font> 
 /*
  *  Data Structure used to manage a POSIX semaphore
<font color='#997700'>@@ -129,6 +130,7 @@
</font> 
 int _POSIX_Semaphore_Create_support(
   const char                *name,
<font color='#000088'>+  size_t                     name_len,
</font>   int                        pshared,
   unsigned int               value,
   POSIX_Semaphore_Control  **the_sem
<font color='#997700'>@@ -162,19 +164,6 @@
</font> );
 
 /*
<font color='#880000'>- *  _POSIX_Semaphore_Name_to_id
- *
- *  DESCRIPTION:
- *
- *  This routine performs name to id translation.
- */
-
-int _POSIX_Semaphore_Name_to_id(
-  const char          *name,
-  sem_t          *id
-);
-
-/*
</font>  *  _POSIX_Semaphore_Translate_core_semaphore_return_code
  *
  *  DESCRIPTION:

<font color='#006600'>diff -u rtems/cpukit/posix/inline/rtems/posix/mqueue.inl:1.19 rtems/cpukit/posix/inline/rtems/posix/mqueue.inl:1.20
--- rtems/cpukit/posix/inline/rtems/posix/mqueue.inl:1.19       Sun Jul 24 18:55:06 2011
+++ rtems/cpukit/posix/inline/rtems/posix/mqueue.inl    Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -127,7 +127,7 @@
</font>   unsigned int priority
 )
 {
<font color='#880000'>-  return priority * -1;
</font><font color='#000088'>+  return (CORE_message_queue_Submit_types) priority * -1;
</font> }
 
 /*
<font color='#997700'>@@ -143,7 +143,19 @@
</font> )
 {
   /* absolute value without a library dependency */
<font color='#880000'>-  return ((priority >= 0) ? priority : -priority);
</font><font color='#000088'>+  return (unsigned int) ((priority >= 0) ? priority : -priority);
+}
+
+/**
+ * @see _POSIX_Name_to_id().
+ */
+RTEMS_INLINE_ROUTINE int _POSIX_Message_queue_Name_to_id(
+  const char          *name,
+  Objects_Id          *id,
+  size_t              *len
+)
+{
+  return _POSIX_Name_to_id( &_POSIX_Message_queue_Information, name, id, len );
</font> }
 
 #endif

<font color='#006600'>diff -u rtems/cpukit/posix/inline/rtems/posix/semaphore.inl:1.18 rtems/cpukit/posix/inline/rtems/posix/semaphore.inl:1.19
--- rtems/cpukit/posix/inline/rtems/posix/semaphore.inl:1.18    Sun Jul 24 18:55:06 2011
+++ rtems/cpukit/posix/inline/rtems/posix/semaphore.inl Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -81,6 +81,18 @@
</font>   return !the_semaphore;
 }
 
<font color='#000088'>+/**
+ * @see _POSIX_Name_to_id().
+ */
+RTEMS_INLINE_ROUTINE int _POSIX_Semaphore_Name_to_id(
+  const char *name,
+  Objects_Id *id,
+  size_t     *len
+)
+{
+  return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
+}
+
</font> #endif
 /*  end of include file */
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/mqueuecreatesupp.c:1.23 rtems/cpukit/posix/src/mqueuecreatesupp.c:1.24
--- rtems/cpukit/posix/src/mqueuecreatesupp.c:1.23      Sun Jul 24 18:55:07 2011
+++ rtems/cpukit/posix/src/mqueuecreatesupp.c   Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -42,9 +42,6 @@
</font> #include <rtems/posix/mqueue.h>
 #include <rtems/posix/time.h>
 
<font color='#880000'>-/* pure ANSI mode does not have this prototype */
-size_t strnlen(const char *, size_t);
-
</font> /*
  *  _POSIX_Message_queue_Create_support
  *
<font color='#997700'>@@ -54,6 +51,7 @@
</font> 
 int _POSIX_Message_queue_Create_support(
   const char                    *name_arg,
<font color='#000088'>+  size_t                         name_len,
</font>   int                            pshared,
   struct mq_attr                *attr_ptr,
   POSIX_Message_queue_Control  **message_queue
<font color='#997700'>@@ -63,9 +61,7 @@
</font>   CORE_message_queue_Attributes *the_mq_attr;
   struct mq_attr                 attr;
   char                          *name;
<font color='#880000'>-  size_t                         n;
</font> 
<font color='#880000'>-  n = strnlen( name_arg, NAME_MAX );
</font>   /* length of name has already been validated */
 
   _Thread_Disable_dispatch();
<font color='#997700'>@@ -99,22 +95,21 @@
</font>     rtems_set_errno_and_return_minus_one( ENFILE );
   }
 
<font color='#880000'>-  the_mq->process_shared  = pshared;
-  the_mq->named = true;
-  the_mq->open_count = 1;
-  the_mq->linked = true;
-
</font>   /*
    * Make a copy of the user's string for name just in case it was
    * dynamically constructed.
    */
<font color='#880000'>-  name = _Workspace_Allocate(n+1);
-  if (!name) {
</font><font color='#000088'>+  name = _Workspace_String_duplicate( name_arg, name_len );
+  if ( !name ) {
</font>     _POSIX_Message_queue_Free( the_mq );
     _Thread_Enable_dispatch();
     rtems_set_errno_and_return_minus_one( ENOMEM );
   }
<font color='#880000'>-  strncpy( name, name_arg, n+1 );
</font><font color='#000088'>+
+  the_mq->process_shared  = pshared;
+  the_mq->named = true;
+  the_mq->open_count = 1;
+  the_mq->linked = true;
</font> 
   /*
    *  NOTE: That thread blocking discipline should be based on the

<font color='#006600'>diff -u rtems/cpukit/posix/src/mqueueopen.c:1.17 rtems/cpukit/posix/src/mqueueopen.c:1.18
--- rtems/cpukit/posix/src/mqueueopen.c:1.17    Wed Nov 30 21:46:36 2011
+++ rtems/cpukit/posix/src/mqueueopen.c Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -58,6 +58,7 @@
</font>   POSIX_Message_queue_Control    *the_mq;
   POSIX_Message_queue_Control_fd *the_mq_fd;
   Objects_Locations               location;
<font color='#000088'>+  size_t                          name_len;
</font> 
   _Thread_Disable_dispatch();
 
<font color='#997700'>@@ -75,7 +76,7 @@
</font>   }
   the_mq_fd->oflag = oflag;
 
<font color='#880000'>-  status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
</font><font color='#000088'>+  status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id, &name_len );
</font> 
   /*
    *  If the name to id translation worked, then the message queue exists
<font color='#997700'>@@ -128,6 +129,7 @@
</font>    */
   status = _POSIX_Message_queue_Create_support(
     name,
<font color='#000088'>+    name_len,
</font>     true,         /* shared across processes */
     attr,
     &the_mq

<font color='#006600'>diff -u rtems/cpukit/posix/src/mqueuesendsupp.c:1.23 rtems/cpukit/posix/src/mqueuesendsupp.c:1.24
--- rtems/cpukit/posix/src/mqueuesendsupp.c:1.23        Sun Jul 24 18:55:07 2011
+++ rtems/cpukit/posix/src/mqueuesendsupp.c     Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -48,7 +48,7 @@
</font>   mqd_t               mqdes,
   const char         *msg_ptr,
   size_t              msg_len,
<font color='#880000'>-  uint32_t            msg_prio,
</font><font color='#000088'>+  unsigned int        msg_prio,
</font>   bool                wait,
   Watchdog_Interval   timeout
 )
<font color='#997700'>@@ -91,7 +91,7 @@
</font>        */
       msg_status = _CORE_message_queue_Submit(
         &the_mq->Message_queue,
<font color='#880000'>-        (void *)msg_ptr,
</font><font color='#000088'>+        msg_ptr,
</font>         msg_len,
         mqdes,      /* mqd_t is an object id */
         NULL,

<font color='#006600'>diff -u rtems/cpukit/posix/src/mqueueunlink.c:1.18 rtems/cpukit/posix/src/mqueueunlink.c:1.19
--- rtems/cpukit/posix/src/mqueueunlink.c:1.18  Sun Jul 24 18:55:08 2011
+++ rtems/cpukit/posix/src/mqueueunlink.c       Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -51,10 +51,11 @@
</font>   int                                   status;
   register POSIX_Message_queue_Control *the_mq;
   Objects_Id                            the_mq_id;
<font color='#000088'>+  size_t                                name_len;
</font> 
   _Thread_Disable_dispatch();
 
<font color='#880000'>-  status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
</font><font color='#000088'>+  status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id, &name_len );
</font>    if ( status != 0 ) {
     _Thread_Enable_dispatch();
     rtems_set_errno_and_return_minus_one( status );

<font color='#006600'>diff -u /dev/null rtems/cpukit/posix/src/psxnametoid.c:1.1
--- /dev/null   Tue Dec 13 07:10:22 2011
+++ rtems/cpukit/posix/src/psxnametoid.c        Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -0,0 +1,58 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2009.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/posix/posixapi.h>
+
+#include <string.h>
+#include <limits.h>
+#include <errno.h>
+
+/* pure ANSI mode does not have this prototype */
+size_t strnlen(const char *, size_t);
+
+int _POSIX_Name_to_id(
+  Objects_Information *information,
+  const char          *name,
+  Objects_Id          *id,
+  size_t              *len
+)
+{
+  int eno = EINVAL;
+  size_t n = 0;
+
+  if ( name != NULL && name [0] != '\0' ) {
+    n = strnlen( name, NAME_MAX );
+
+    if ( n < NAME_MAX ) {
+      Objects_Name_or_id_lookup_errors status = _Objects_Name_to_id_string(
+        information,
+        name,
+        id
+      );
+
+      if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) {
+        eno = 0;
+      } else {
+        eno = ENOENT;
+      }
+    } else {
+      eno = ENAMETOOLONG;
+    }
+  }
+
+  *len = n;
+
+  return eno;
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/posix/src/semaphorecreatesupp.c:1.16 rtems/cpukit/posix/src/semaphorecreatesupp.c:1.17
--- rtems/cpukit/posix/src/semaphorecreatesupp.c:1.16   Thu Aug  6 14:26:56 2009
+++ rtems/cpukit/posix/src/semaphorecreatesupp.c        Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -24,13 +24,11 @@
</font> 
 #include <rtems/system.h>
 #include <rtems/score/object.h>
<font color='#000088'>+#include <rtems/score/wkspace.h>
</font> #include <rtems/posix/semaphore.h>
 #include <rtems/posix/time.h>
 #include <rtems/seterr.h>
 
<font color='#880000'>-/* pure ANSI mode does not have this prototype */
-size_t strnlen(const char *, size_t);
-
</font> /*
  *  _POSIX_Semaphore_Create_support
  *
<font color='#997700'>@@ -39,7 +37,8 @@
</font>  *  sem_open.
  */
 int _POSIX_Semaphore_Create_support(
<font color='#880000'>-  const char                *name,
</font><font color='#000088'>+  const char                *name_arg,
+  size_t                     name_len,
</font>   int                        pshared,
   unsigned int               value,
   POSIX_Semaphore_Control  **the_sem
<font color='#997700'>@@ -47,26 +46,35 @@
</font> {
   POSIX_Semaphore_Control   *the_semaphore;
   CORE_semaphore_Attributes *the_sem_attr;
<font color='#880000'>-  char                      *name_p = (char *)name;
</font><font color='#000088'>+  char                      *name;
</font> 
   /* Sharing semaphores among processes is not currently supported */
   if (pshared != 0)
     rtems_set_errno_and_return_minus_one( ENOSYS );
 
<font color='#880000'>-  if ( name ) {
-    if ( strnlen( name, NAME_MAX ) >= NAME_MAX )
-      rtems_set_errno_and_return_minus_one( ENAMETOOLONG );
-  }
-
</font>   _Thread_Disable_dispatch();
 
   the_semaphore = _POSIX_Semaphore_Allocate();
<font color='#880000'>-
</font>   if ( !the_semaphore ) {
     _Thread_Enable_dispatch();
     rtems_set_errno_and_return_minus_one( ENOSPC );
   }
 
<font color='#000088'>+  /*
+   * Make a copy of the user's string for name just in case it was
+   * dynamically constructed.
+   */
+  if ( name_arg != NULL ) {
+    name = _Workspace_String_duplicate( name_arg, name_len );
+    if ( !name ) {
+      _POSIX_Semaphore_Free( the_semaphore );
+      _Thread_Enable_dispatch();
+      rtems_set_errno_and_return_minus_one( ENOMEM );
+    }
+  } else {
+    name = NULL;
+  }
+
</font>   the_semaphore->process_shared  = pshared;
 
   if ( name ) {
<font color='#997700'>@@ -103,7 +111,7 @@
</font>   _Objects_Open_string(
     &_POSIX_Semaphore_Information,
     &the_semaphore->Object,
<font color='#880000'>-    name_p
</font><font color='#000088'>+    name
</font>   );
 
   *the_sem = the_semaphore;

<font color='#006600'>diff -u rtems/cpukit/posix/src/seminit.c:1.9 rtems/cpukit/posix/src/seminit.c:1.10
--- rtems/cpukit/posix/src/seminit.c:1.9        Sun Jul 24 18:55:09 2011
+++ rtems/cpukit/posix/src/seminit.c    Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -45,6 +45,7 @@
</font> 
   status = _POSIX_Semaphore_Create_support(
     NULL,
<font color='#000088'>+    0,
</font>     pshared,
     value,
     &the_semaphore

<font color='#006600'>diff -u rtems/cpukit/posix/src/semopen.c:1.17 rtems/cpukit/posix/src/semopen.c:1.18
--- rtems/cpukit/posix/src/semopen.c:1.17       Wed Nov 30 21:05:17 2011
+++ rtems/cpukit/posix/src/semopen.c    Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -51,10 +51,10 @@
</font>   mode_t                     mode;
   unsigned int               value = 0;
   int                        status;
<font color='#880000'>-  sem_t                      the_semaphore_id;
-  sem_t                     *id;
</font><font color='#000088'>+  Objects_Id                 the_semaphore_id;
</font>   POSIX_Semaphore_Control   *the_semaphore;
   Objects_Locations          location;
<font color='#000088'>+  size_t                     name_len;
</font> 
   _Thread_Disable_dispatch();
 
<font color='#997700'>@@ -65,7 +65,7 @@
</font>     va_end(arg);
   }
 
<font color='#880000'>-  status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
</font><font color='#000088'>+  status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id, &name_len );
</font> 
   /*
    *  If the name to id translation worked, then the semaphore exists
<font color='#997700'>@@ -96,7 +96,7 @@
</font>       rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
     }
 
<font color='#880000'>-    the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
</font><font color='#000088'>+    the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
</font>     the_semaphore->open_count += 1;
     _Thread_Enable_dispatch();
     _Thread_Enable_dispatch();
<font color='#997700'>@@ -110,6 +110,7 @@
</font> 
   status =_POSIX_Semaphore_Create_support(
     name,
<font color='#000088'>+    name_len,
</font>     false,         /* not shared across processes */
     value,
     &the_semaphore
<font color='#997700'>@@ -127,9 +128,8 @@
</font> return_id:
   #if defined(RTEMS_USE_16_BIT_OBJECT)
     the_semaphore->Semaphore_id = the_semaphore->Object.id;
<font color='#880000'>-    id = &the_semaphore->Semaphore_id;
</font><font color='#000088'>+    return &the_semaphore->Semaphore_id;
</font>   #else
<font color='#880000'>-    id = (sem_t *)&the_semaphore->Object.id;
</font><font color='#000088'>+    return (sem_t *)&the_semaphore->Object.id;
</font>   #endif
<font color='#880000'>-  return id;
</font> }

<font color='#006600'>diff -u rtems/cpukit/posix/src/semunlink.c:1.15 rtems/cpukit/posix/src/semunlink.c:1.16
--- rtems/cpukit/posix/src/semunlink.c:1.15     Sun Jul 24 18:55:09 2011
+++ rtems/cpukit/posix/src/semunlink.c  Tue Dec 13 06:56:53 2011
</font><font color='#997700'>@@ -42,11 +42,12 @@
</font> {
   int  status;
   register POSIX_Semaphore_Control *the_semaphore;
<font color='#880000'>-  sem_t                        the_semaphore_id;
</font><font color='#000088'>+  Objects_Id the_semaphore_id;
+  size_t name_len;
</font> 
   _Thread_Disable_dispatch();
 
<font color='#880000'>-  status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
</font><font color='#000088'>+  status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id, &name_len );
</font>   if ( status != 0 ) {
     _Thread_Enable_dispatch();
     rtems_set_errno_and_return_minus_one( status );
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>