If the value changes between sem_wait's read and the gsync_wait call,
the kernel will return KERN_INVALID_ARGUMENT, which we have to interpret
as the value having already changed.
This fixes applications (e.g. libgo) seeing sem_wait erroneously return
KERN_INVALID_ARGUMENT.
((unsigned int *) &sem->data) + SEM_VALUE_OFFSET,
0, flags);
- if (err != 0)
+ if (err != 0 && err != KERN_INVALID_ARGUMENT)
{
/* Error, interruption or timeout, abort. */
if (err == KERN_TIMEDOUT)
err = __lll_wait_intr (&isem->value,
SEM_NWAITERS_MASK, flags);
- if (err != 0)
+ if (err != 0 && err != KERN_INVALID_ARGUMENT)
{
/* Error, interruption or timeout, abort. */
if (err == KERN_TIMEDOUT)