This is a tough one.
Cannot create a POSIX named semaphore (sem_open
) no matter the name on a system where there are no semaphores (thus no chance of name overlapping). This is a non-privileged user able to create a shared memory using shmget.
Platform: Solaris 10
Hardware: Intel Xeon E5000 series CPU
Does not happen on other Solaris 10 platforms running AMD CPUs with non-privileged users. Does not happen on Linux machines. No apparent differences between these machines, other than the fact that this machine is very likely virtualized.
Code:
const char* name = "/permission_test_semaphore";
sem_t* sem = sem_open(name, O_CREAT | O_EXCL, 0644, 0);
if (SEM_FAILED == sem)
{
printf("Could not create test semaphore %s, errno = %d\n", name, errno);
}
Output is:
Could not create test semaphore /permission_test_semaphore, errno = 13
Any ideas are welcome -- my hopes are not up.