aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/asm-generic/futex.h
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2019-04-10 11:51:54 +0100
committerWill Deacon <will.deacon@arm.com>2019-04-26 13:57:55 +0100
commit427503519739e779c0db8afe876c1b33f3ac60ae (patch)
treeadb1c420287cb4a6fe1e84b098ef51eb61d964a0 /include/asm-generic/futex.h
parentarm64: futex: Avoid copying out uninitialised stack in failed cmpxchg() (diff)
downloadwireguard-linux-427503519739e779c0db8afe876c1b33f3ac60ae.tar.xz
wireguard-linux-427503519739e779c0db8afe876c1b33f3ac60ae.zip
futex: Update comments and docs about return values of arch futex code
The architecture implementations of 'arch_futex_atomic_op_inuser()' and 'futex_atomic_cmpxchg_inatomic()' are permitted to return only -EFAULT, -EAGAIN or -ENOSYS in the case of failure. Update the comments in the asm-generic/ implementation and also a stray reference in the robust futex documentation. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/asm-generic/futex.h')
-rw-r--r--include/asm-generic/futex.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h
index fcb61b4659b3..8666fe7f35d7 100644
--- a/include/asm-generic/futex.h
+++ b/include/asm-generic/futex.h
@@ -23,7 +23,9 @@
*
* Return:
* 0 - On success
- * <0 - On error
+ * -EFAULT - User access resulted in a page fault
+ * -EAGAIN - Atomic operation was unable to complete due to contention
+ * -ENOSYS - Operation not supported
*/
static inline int
arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr)
@@ -85,7 +87,9 @@ out_pagefault_enable:
*
* Return:
* 0 - On success
- * <0 - On error
+ * -EFAULT - User access resulted in a page fault
+ * -EAGAIN - Atomic operation was unable to complete due to contention
+ * -ENOSYS - Function not implemented (only if !HAVE_FUTEX_CMPXCHG)
*/
static inline int
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,