svn commit: r200274 - head/lib/libc/gen

Robert Watson rwatson at FreeBSD.org
Wed Dec 9 16:24:29 PST 2009


On Wed, 9 Dec 2009, Andrew Gallatin wrote:

> John Baldwin wrote:
>
>> The fact that we don't fail attempts to use pshared outright is probably 
>> dubious.  They cannot possibly work as currently implemented aside from 
>> fork() since the structure embeds a file descriptor and file descriptor 
>> indices are a per-process namespace, not a global namespace.
>
> FWIW, this is what confused me.  It tends to be kind of a land-mine, since 
> programs can be ported from Linux, and appear to work at first for casual 
> use.  If we don't support pshared, we should return an error from sem_init() 
> to make it obvious.
>
> Also, perhaps the sem_init() man page should mention sem_open(), since that 
> seems to be the only way to really share a semaphore between processes on 
> FreeBSD.

It's beginning to sound like our POSIX semaphores should be behaving more like 
umtx, which requires only a shared page, and less like file descriptors.  Of 
course, that would make the global namespace more tricky...

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the svn-src-head mailing list