> From: Miod Vallat <m...@online.fr>
> Date: Mon, 15 May 2017 06:06:22 +0000 (UTC)
> 
> >                           So I implemented a new function called
> > copyin_futex(9), which is all we really need.
> 
> But it is not specific to futex - in fact, it could be used in syscall()
> as well.
> 
> Better call it fuword() or aligned_fuword() since it has the extra
> alignment requirement that fuword() didn't have.

Heh, we had a bikeshed about the name already.  To quote myself:

> Problem with the classic fuword(9) API is that it return -1 on error
> (when copyin(9) would return EFAULT).  So you can't distinguish
> between the futex being -1 and an invalid address.  FreeBSD has
> fueword32(9), which doesn't suffer from this problem (but returns -1
> instead of EFAULT upon error).

So in the end we settled on copyin32() in order not to introduce an
interface that has slightly different semantics than the FreeBSD one.

The reason I changed this to copyin_futex() is that the in this
proposal the call is only truly atomic for MULTIPROCESSOR kernels.
This is good enough for futex(2), but I'm not absolutely confident
that it is good enough for all possible use cases.

That said, if there is consensus that copyin32() is better than
copyin_futex() I'll happily change the name.

Cheers,

Mark

Reply via email to