Subject: Re: POSIX named semaphores naming restrictions in sem_open()
To: None <ianzag@megasignal.com>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 09/10/2004 01:59:20
On Fri, Sep 10, 2004 at 12:43:00PM +0700, Ian Zagorskih wrote:
>
> POSIX documentation indicates that lacking a leading slash character may lead
> to failure but does not require it. Of course if i got POSIX docs right.
[...]
> Let's take for example some application that doesn't name semaphores this way.
> It will be obviously "broken" on NetBSD while technically it is POSIX
> compatible and could be fully usable in NetBSD environment.
Your two claims about the standard are inconsistent. First you (correctly)
note that semaphore names without a leading slash yield "implementation
defined" behaviour under the POSIX standard. Then you claim that an
application that relies on the behaviour of a *particular implementation*
"is POSIX compatible".
The second claim is wrong. Such an application is inherently nonportable.
Acceptable "implementation defined behaviour" pursuant to the standard would
include running Emacs in Hanoi mode, deliberately setting the CPU on fire,
or sending an electric shock through the keyboard to kill the user. For
an application relying on "implementation defined behaviour" to be portable
to systems conforming to the standard, all these (and infinitely many more
implementation (mis-)behaviours) would have to be considered acceptable
behaviour *of the application*.
So, are they? No? Didn't think so. You have a nonportable application
on your hands. You should fix it.
Thor