Recently I ran into a problem, when trying to install dev-python/billiard .
It said something about semaphores not being available on my system
As +Samuele Santi pointed out, one could uncomment the line
#define POSIX_SEMAPHORES_NOT_ENABLED 1
Funny enough, reinstalling python:2.7 also turned this line into
/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
Ergo: it's enough to re-merge python:2.7, but we thought it's worth mentioning to developers and others who run into this bug.
Steps to Reproduce:
1. Have a somewhat recent build of Gentoo (amd64) with python:2.7
2. Try to merge dev-python/billiard
SEM_HANDLE not defined or something like that.
Just had a sandbox violation trying to build Python 3.2, the failed conftest checks for semaphores and because I did not have tmpfs mounted on /dev/shm, "sem_open" was using the only tmpfs mount which was /run. Not sure if this is relevant here, but any extra info is good info. =)
I've come across this before (and so have others, see bug #462542, but I think there's at least one other that I actually commented on). The short version is that with current glibc you need to have a tmpfs mounted on /dev/shm for shared memory (and some other bits) to work. I think only more recent glibcs have the fallback described in comment #1.
For the original reporter: please check what /dev/shm is. It should be on a tmpfs, or possibly a symlink to a tmpfs.
I added a check to src_configure for this. See bug 496328.