From 8064bfa5369c6856f606004d02e48ab275e05bed Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 23 Jun 2016 12:43:51 +0200 Subject: [PATCH] futex.2: Fix descriptions of various timeouts Reported-by: Thomas Gleixner Reported-by: Darren Hart Signed-off-by: Michael Kerrisk --- man2/futex.2 | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/man2/futex.2 b/man2/futex.2 index e24202d91..a769a9503 100644 --- a/man2/futex.2 +++ b/man2/futex.2 @@ -242,15 +242,15 @@ and .\" commit 337f13046ff03717a9e99675284a817527440a49 operations. -If this option is set, the kernel treats +If this option is set, the kernel measures the .I timeout -as an absolute time based on -.BR CLOCK_REALTIME . +against the +.BR CLOCK_REALTIME +clock. -If this option is not set, the kernel treats +If this option is not set, the kernel measures the .I timeout -as a relative time, -measured against the +against the .BR CLOCK_MONOTONIC clock. .PP @@ -300,8 +300,8 @@ value change and will not start to sleep. If the .I timeout -argument is non-NULL, its contents specify a relative timeout for the wait, -measured according to the +is not NULL, the structure it points to specifies +a relative timeout for the wait, measured according to the .BR CLOCK_MONOTONIC clock. (This interval will be rounded up to the system clock granularity, @@ -691,6 +691,15 @@ See the description of .BR FUTEX_WAKE_BITSET for further details. +If +.I timeout +is not NULL, the structure it points to specifies +an absolute timeout for the wait operation. +If +.I timeout +is NULL, the operation can block indefinitely. + + The .I uaddr2 argument is ignored. @@ -1027,7 +1036,10 @@ and performs deadlock detection. The .I timeout argument provides a timeout for the lock attempt. -It is interpreted as an absolute time, measured against the +If +.I timeout +is not NULL, the structure it points to specifies +an absolute timeout, measured against the .BR CLOCK_REALTIME clock. If @@ -1186,10 +1198,8 @@ operation fails with the error If .I timeout -is not NULL, it specifies a timeout for the wait operation; -this timeout is interpreted as outlined above in the description of the -.BR FUTEX_CLOCK_REALTIME -option. +is not NULL, the structure it points to specifies +an absolute timeout for the wait operation. If .I timeout is NULL, the operation can block indefinitely.