<div dir="auto">I have no idea how that is much clearer except that pthreads have defined macros for scope and thus an invalid value is an error.<div dir="auto"><br></div><div dir="auto">But POSIX isn't good at addressing error cases which existed based on the profiles defined in PSE52-54. And those were not updated for POSIX 2008 or 2013 </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sep 8, 2017 10:16 AM, "Sebastian Huber" <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
----- Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> schrieb:<br>
> On Fri, Sep 8, 2017 at 8:33 AM, Sebastian Huber <<br>
> <a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-<wbr>brains.de</a>> wrote:<br>
><br>
> > Since we have only one process, sharing between processes is trivial.<br>
> ><br>
> > Close #3124.<br>
> > ---<br>
> >  cpukit/posix/include/rtems/<wbr>posix/semaphore.h     |  1 -<br>
> >  cpukit/posix/include/rtems/<wbr>posix/semaphoreimpl.h |  1 -<br>
> >  cpukit/posix/src/<wbr>semaphorecreatesupp.c           |  7 -------<br>
> >  cpukit/posix/src/seminit.c                       |  1 -<br>
> >  cpukit/posix/src/semopen.c                       |  1 -<br>
> >  testsuites/psxtests/psxsem01/<wbr>init.c              | 14 +++++++++-----<br>
> >  6 files changed, 9 insertions(+), 16 deletions(-)<br>
> ><br>
> > diff --git a/cpukit/posix/include/rtems/<wbr>posix/semaphore.h<br>
> > b/cpukit/posix/include/rtems/<wbr>posix/semaphore.h<br>
> > index 45de4a93b9..6598397052 100644<br>
> > --- a/cpukit/posix/include/rtems/<wbr>posix/semaphore.h<br>
> > +++ b/cpukit/posix/include/rtems/<wbr>posix/semaphore.h<br>
> > @@ -43,7 +43,6 @@ extern "C" {<br>
> >  typedef struct {<br>
> >     Objects_Control         Object;<br>
> >     CORE_semaphore_Control  Semaphore;<br>
> > -   int                     process_shared;<br>
> >     bool                    named;<br>
> >     bool                    linked;<br>
> >     uint32_t                open_count;<br>
> > diff --git a/cpukit/posix/include/rtems/<wbr>posix/semaphoreimpl.h<br>
> > b/cpukit/posix/include/rtems/<wbr>posix/semaphoreimpl.h<br>
> > index 2bafbe9b97..43440298ec 100644<br>
> > --- a/cpukit/posix/include/rtems/<wbr>posix/semaphoreimpl.h<br>
> > +++ b/cpukit/posix/include/rtems/<wbr>posix/semaphoreimpl.h<br>
> > @@ -78,7 +78,6 @@ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control<br>
> > *_POSIX_Semaphore_Get(<br>
> >  int _POSIX_Semaphore_Create_<wbr>support(<br>
> >    const char                *name,<br>
> >    size_t                     name_len,<br>
> > -  int                        pshared,<br>
> >    unsigned int               value,<br>
> >    POSIX_Semaphore_Control  **the_sem<br>
> >  );<br>
> > diff --git a/cpukit/posix/src/<wbr>semaphorecreatesupp.c b/cpukit/posix/src/<br>
> > semaphorecreatesupp.c<br>
> > index d66e1942c9..4a33336230 100644<br>
> > --- a/cpukit/posix/src/<wbr>semaphorecreatesupp.c<br>
> > +++ b/cpukit/posix/src/<wbr>semaphorecreatesupp.c<br>
> > @@ -42,7 +42,6 @@<br>
> >  int _POSIX_Semaphore_Create_<wbr>support(<br>
> >    const char                *name_arg,<br>
> >    size_t                     name_len,<br>
> > -  int                        pshared,<br>
> >    unsigned int               value,<br>
> >    POSIX_Semaphore_Control  **the_sem<br>
> >  )<br>
> > @@ -50,10 +49,6 @@ int _POSIX_Semaphore_Create_<wbr>support(<br>
> >    POSIX_Semaphore_Control *the_semaphore;<br>
> >    char                    *name;<br>
> ><br>
> > -  /* Sharing semaphores among processes is not currently supported */<br>
> > -  if (pshared != 0)<br>
> > -    rtems_set_errno_and_return_<wbr>minus_one( ENOSYS );<br>
> ><br>
><br>
> Why are you deleting this error check? I can see not storing the value or<br>
> passing<br>
> it to create support. But I think it still should be validated. We only<br>
> support<br>
> requests for process private. Anything else is an error.<br>
<br>
Why is this an error? With only one process its easy to support sharing between processes. The text in the semaphore documentation is a bit vague. This description is a bit more clear:<br>
<br>
<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_getpshared.html" rel="noreferrer" target="_blank">http://pubs.opengroup.org/<wbr>onlinepubs/9699919799/<wbr>functions/pthread_mutexattr_<wbr>getpshared.html</a><br>
<br>
--<br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : <a href="tel:%2B49%2089%20189%2047%2041-16" value="+4989189474116">+49 89 189 47 41-16</a><br>
Fax     : <a href="tel:%2B49%2089%20189%2047%2041-09" value="+4989189474109">+49 89 189 47 41-09</a><br>
E-Mail  : sebastian.huber at <a href="http://embedded-brains.de" rel="noreferrer" target="_blank">embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine gesch&auml;ftliche Mitteilung im Sinne des EHUG.<br>
</blockquote></div></div>