summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/futex.29
-rw-r--r--sys/kern/sys_futex.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/libc/sys/futex.2 b/lib/libc/sys/futex.2
index d8528681ba4..1fc2d080a95 100644
--- a/lib/libc/sys/futex.2
+++ b/lib/libc/sys/futex.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: futex.2,v 1.3 2017/04/28 17:54:24 mpi Exp $
+.\" $OpenBSD: futex.2,v 1.4 2018/04/24 17:19:35 pirofti Exp $
.\"
.\" Copyright (c) 2017 Martin Pieuchot
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 28 2017 $
+.Dd $Mdocdate: April 24 2018 $
.Dt FUTEX 2
.Os
.Sh NAME
@@ -122,8 +122,13 @@ The
expired before the thread was woken up
.It Bq Er EINTR
A signal arrived.
+.It Bq Er ECANCELED
+A signal arrived and
+.Fa SA_RESTART
+was set.
.El
.Sh SEE ALSO
+.Xr sigaction 2 ,
.Xr pthread_cond_wait 3 ,
.Xr pthread_mutex_lock 3 ,
.Xr tsleep 9
diff --git a/sys/kern/sys_futex.c b/sys/kern/sys_futex.c
index a31dfdd41a5..dac6e84b9e0 100644
--- a/sys/kern/sys_futex.c
+++ b/sys/kern/sys_futex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_futex.c,v 1.6 2018/01/08 22:33:13 mpi Exp $ */
+/* $OpenBSD: sys_futex.c,v 1.7 2018/04/24 17:19:35 pirofti Exp $ */
/*
* Copyright (c) 2016-2017 Martin Pieuchot
@@ -226,7 +226,7 @@ futex_wait(uint32_t *uaddr, uint32_t val, const struct timespec *timeout)
error = rwsleep(p, &ftlock, PUSER|PCATCH, "fsleep", (int)to_ticks);
if (error == ERESTART)
- error = EINTR;
+ error = ECANCELED;
else if (error == EWOULDBLOCK) {
/* A race occured between a wakeup and a timeout. */
if (p->p_futex == NULL)