summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-08-31 20:23:11 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-08-31 20:23:11 +0000
commite1bbf285aad9b199b527abcbbab66ae334ff68bb (patch)
tree78f3c74cf580233fd90986d029df889a72086ac6
parent94456107c905b3f012cd5fe6b26619b2e06ce582 (diff)
accept4() should be a cancellation point.
Update the list in the pthread_testcancel(3) manpage: several were missing. noted by miod@
-rw-r--r--lib/libpthread/man/pthread_testcancel.39
-rw-r--r--lib/librthread/rthread_cancel.c20
-rw-r--r--lib/librthread/shlib_version2
3 files changed, 27 insertions, 4 deletions
diff --git a/lib/libpthread/man/pthread_testcancel.3 b/lib/libpthread/man/pthread_testcancel.3
index edcc90a5168..baab5af2057 100644
--- a/lib/libpthread/man/pthread_testcancel.3
+++ b/lib/libpthread/man/pthread_testcancel.3
@@ -1,9 +1,9 @@
-.\" $OpenBSD: pthread_testcancel.3,v 1.15 2013/06/05 03:44:50 tedu Exp $
+.\" $OpenBSD: pthread_testcancel.3,v 1.16 2014/08/31 20:23:10 guenther Exp $
.\"
.\"
.\" David Leonard, 1999. Public Domain.
.\"
-.Dd $Mdocdate: June 5 2013 $
+.Dd $Mdocdate: August 31 2014 $
.Dt PTHREAD_TESTCANCEL 3
.Os
.Sh NAME
@@ -105,6 +105,7 @@ base interfaces:
.Fn connect ,
.Fn creat ,
.Fn fcntl "F_SETLKW" ,
+.Fn fdatasync ,
.Fn fsync ,
.Fn lockf ,
.Fn msgrcv ,
@@ -120,6 +121,7 @@ base interfaces:
.Fn pthread_cond_wait ,
.Fn pthread_join ,
.Fn pthread_testcancel ,
+.Fn pwrite ,
.Fn read ,
.Fn readv ,
.Fn recv ,
@@ -144,9 +146,12 @@ base interfaces:
In addition,
cancellation points will occur when a thread is executing the following
extension interfaces:
+.Fn accept4 ,
.Fn closefrom ,
+.Fn ppoll ,
.Fn preadv ,
.Fn pwritev ,
+.Fn wait3 ,
.Fn wait4 .
.Sh RETURN VALUES
If successful, the
diff --git a/lib/librthread/rthread_cancel.c b/lib/librthread/rthread_cancel.c
index 2fb5e0b4814..283a86a6c43 100644
--- a/lib/librthread/rthread_cancel.c
+++ b/lib/librthread/rthread_cancel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_cancel.c,v 1.8 2013/10/04 03:31:16 guenther Exp $ */
+/* $OpenBSD: rthread_cancel.c,v 1.9 2014/08/31 20:23:10 guenther Exp $ */
/* $snafu: libc_tag.c,v 1.4 2004/11/30 07:00:06 marc Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -27,7 +27,13 @@
#include "rthread.h"
+/*
+ * If you add anything here, make sure to add it to the list in the
+ * pthread_testcancel(3) manpage too.
+ */
+
int _thread_sys_accept(int, struct sockaddr *, socklen_t *);
+int _thread_sys_accept4(int, struct sockaddr *, socklen_t *, int);
int _thread_sys_close(int);
int _thread_sys_closefrom(int);
int _thread_sys_connect(int, const struct sockaddr *, socklen_t);
@@ -118,6 +124,18 @@ accept(int fd, struct sockaddr *addr, socklen_t *addrlen)
return (rv);
}
+int
+accept4(int fd, struct sockaddr *addr, socklen_t *addrlen, int flags)
+{
+ pthread_t self = pthread_self();
+ int rv;
+
+ _enter_cancel(self);
+ rv = _thread_sys_accept4(fd, addr, addrlen, flags);
+ _leave_cancel(self);
+ return (rv);
+}
+
#if 0
aio_suspend() /* don't have yet */
clock_nanosleep() /* don't have yet */
diff --git a/lib/librthread/shlib_version b/lib/librthread/shlib_version
index 94727e17b3a..7c92aff4893 100644
--- a/lib/librthread/shlib_version
+++ b/lib/librthread/shlib_version
@@ -1,2 +1,2 @@
major=18
-minor=0
+minor=1