[libdispatch-dev] [PATCH 09/17] portability

Robert Watson robert at fledge.watson.org
Wed Oct 28 10:41:31 PDT 2009

On Sun, 18 Oct 2009, Paolo Bonzini wrote:

> - sem_t is not a scalar under Linux, check if initialized with memcmp

With the assumpion that sem_t was a pointer, I was OK with the current code 
(as it made similar assumptions to the Mach semaphore parts).  However, with 
other possible interpretations of sem_t, I'm less comfortable with the 
assumption that a value of zero reflects an invalid (or rather, unallocated) 
semaphore, since it could well be a valid semaphore ID if semaphores are file 
descriptors.  Any chance I could convince you to refactor the code to 
eliminate this assumption (perhaps an explicit "allocated" flag?).


More information about the libdispatch-dev mailing list