summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/uthread_connect.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2003-12-23 19:31:06 +0000
committerBrad Smith <brad@cvs.openbsd.org>2003-12-23 19:31:06 +0000
commitdfba0d060b608e83a1fd3fc0398a3ade9d479e4b (patch)
tree42a4346ed8e9895d2642a758c2ea40f39bf66bb8 /lib/libpthread/uthread/uthread_connect.c
parent59c4a1cc1296ea258ae7b7c86aca3cced0776b24 (diff)
Make accept(), connect(), recvfrom(), recvmsg(), sendmsg(),
and sendto() cancellation points, as required by POSIX.1-2001. From: FreeBSD' libc_r ok marc@
Diffstat (limited to 'lib/libpthread/uthread/uthread_connect.c')
-rw-r--r--lib/libpthread/uthread/uthread_connect.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_connect.c b/lib/libpthread/uthread/uthread_connect.c
index ad0a6ea8921..85e344f2975 100644
--- a/lib/libpthread/uthread/uthread_connect.c
+++ b/lib/libpthread/uthread/uthread_connect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_connect.c,v 1.4 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_connect.c,v 1.5 2003/12/23 19:31:05 brad Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -47,6 +47,9 @@ connect(int fd, const struct sockaddr * name, socklen_t namelen)
struct sockaddr tmpname;
int errnolen, ret, tmpnamelen;
+ /* This is a cancellation point: */
+ _thread_enter_cancellation_point();
+
if ((ret = _FD_LOCK(fd, FD_RDWR, NULL)) == 0) {
if ((ret = _thread_sys_connect(fd, name, namelen)) < 0) {
if (!(_thread_fd_table[fd]->flags & O_NONBLOCK) &&
@@ -75,6 +78,10 @@ connect(int fd, const struct sockaddr * name, socklen_t namelen)
}
_FD_UNLOCK(fd, FD_RDWR);
}
+
+ /* No longer in a cancellation point: */
+ _thread_leave_cancellation_point();
+
return (ret);
}
#endif