Subject: POSIX named semaphores naming restrictions in sem_open()
To: None <>
From: Ian Zagorskih <>
List: tech-kern
Date: 09/09/2004 22:10:30
According to POSIX specification semaphore name is not required to be started 
with slash character:

The name argument points to a string naming a semaphore object. It is 
unspecified whether the name appears in the file system and is visible to 
functions that take pathnames as arguments. The name argument conforms to the 
construction rules for a pathname. If name begins with the slash character, 
then processes calling sem_open() with the same value of name shall refer to 
the same semaphore object, as long as that name has not been removed. If name 
does not begin with the slash character, the effect is 
implementation-defined. The interpretation of slash characters other than the 
leading slash character in name is implementation-defined.

According to /sys/kern/uipc_sem.c NetBSD realization explicitly requires 
leading slash character. On the other hand, AFAIU in NetBSD named semaphores 
are pure kernel objects and do no have any relations with file system. So, 
technically, object name can be composed from any characters in any 
variations (except 0x0).

Any ideas why it was done this way ? Probably i'm missing something important. 
Please enlight me :)

// wbr