Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
fstat should not fail under normal circumstances, so this fix is
mostly theoretical.
|
|
also fix one minor bug: failure to free the early-reserved slot when
the semaphore later found to already be mapped.
|
|
this function was overly complicated and not even obviously correct.
avoid using openat/linkat just like in shm_open, and instead expand
pathname using code shared with shm_open. remove bogus (and dangerous,
with priorities) use of spinlocks.
this commit also heavily streamlines the code and ensures there are no
failure cases that can happen after a new semaphore has been created
in the filesystem, since that case is unreportable.
|
|
this did not matter because we don't yet treat process-shared special.
when private futex support is added, however, it will matter.
|
|
|
|
|
|
|
|
multiple opens of the same named semaphore must return the same
pointer, and only the last close can unmap it. thus the ugly global
state keeping track of mappings. the maximum number of distinct named
semaphores that can be opened is limited sufficiently small that the
linear searches take trivial time, especially compared to the syscall
overhead of these functions.
|
|
|