diff options
author | ru <ru@FreeBSD.org> | 2002-12-19 11:39:20 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-12-19 11:39:20 +0000 |
commit | d5c27df6a8d1490193d55f7d71e972285829a296 (patch) | |
tree | d7465a589c1cbf86ee2cc4472110d1c9f954464a /lib/libc_r | |
parent | 8d1bd259938ab546f0c3a53bfce447f7de286559 (diff) | |
download | FreeBSD-src-d5c27df6a8d1490193d55f7d71e972285829a296.zip FreeBSD-src-d5c27df6a8d1490193d55f7d71e972285829a296.tar.gz |
Make accept(), connect(), recvfrom(), recvmsg(), sendmsg(),
and sendto() cancelation points, as required by POSIX.1-2001.
Reviewed by: deischen
Diffstat (limited to 'lib/libc_r')
-rw-r--r-- | lib/libc_r/uthread/uthread_accept.c | 14 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_connect.c | 14 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_recvfrom.c | 15 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_recvmsg.c | 14 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_sendmsg.c | 14 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_sendto.c | 15 |
6 files changed, 80 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_accept.c b/lib/libc_r/uthread/uthread_accept.c index 8f90336..f045fc1 100644 --- a/lib/libc_r/uthread/uthread_accept.c +++ b/lib/libc_r/uthread/uthread_accept.c @@ -39,7 +39,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_accept, accept); +__weak_reference(__accept, accept); int _accept(int fd, struct sockaddr * name, socklen_t *namelen) @@ -109,3 +109,15 @@ _accept(int fd, struct sockaddr * name, socklen_t *namelen) /* Return the socket file descriptor or -1 on error: */ return (ret); } + +int +__accept(int fd, struct sockaddr * name, socklen_t *namelen) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _accept(fd, name, namelen); + _thread_leave_cancellation_point(); + + return (ret); +} diff --git a/lib/libc_r/uthread/uthread_connect.c b/lib/libc_r/uthread/uthread_connect.c index a3fe75f..dfdcb21 100644 --- a/lib/libc_r/uthread/uthread_connect.c +++ b/lib/libc_r/uthread/uthread_connect.c @@ -38,7 +38,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_connect, connect); +__weak_reference(__connect, connect); int _connect(int fd, const struct sockaddr * name, socklen_t namelen) @@ -77,3 +77,15 @@ _connect(int fd, const struct sockaddr * name, socklen_t namelen) } return (ret); } + +int +__connect(int fd, const struct sockaddr * name, socklen_t namelen) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _connect(fd, name, namelen); + _thread_leave_cancellation_point(); + + return (ret); +} diff --git a/lib/libc_r/uthread/uthread_recvfrom.c b/lib/libc_r/uthread/uthread_recvfrom.c index d6f8da1..e18d449 100644 --- a/lib/libc_r/uthread/uthread_recvfrom.c +++ b/lib/libc_r/uthread/uthread_recvfrom.c @@ -38,7 +38,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_recvfrom, recvfrom); +__weak_reference(__recvfrom, recvfrom); ssize_t _recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr * from, @@ -74,3 +74,16 @@ _recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr * from, } return (ret); } + +ssize_t +__recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr * from, + socklen_t *from_len) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _recvfrom(fd, buf, len, flags, from, from_len); + _thread_leave_cancellation_point(); + + return (ret); +} diff --git a/lib/libc_r/uthread/uthread_recvmsg.c b/lib/libc_r/uthread/uthread_recvmsg.c index cae23f3..3ecae3f 100644 --- a/lib/libc_r/uthread/uthread_recvmsg.c +++ b/lib/libc_r/uthread/uthread_recvmsg.c @@ -38,7 +38,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_recvmsg, recvmsg); +__weak_reference(__recvmsg, recvmsg); ssize_t _recvmsg(int fd, struct msghdr *msg, int flags) @@ -73,3 +73,15 @@ _recvmsg(int fd, struct msghdr *msg, int flags) } return (ret); } + +ssize_t +__recvmsg(int fd, struct msghdr *msg, int flags) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _recvmsg(fd, msg, flags); + _thread_leave_cancellation_point(); + + return (ret); +} diff --git a/lib/libc_r/uthread/uthread_sendmsg.c b/lib/libc_r/uthread/uthread_sendmsg.c index 46f85cb..5bb825c 100644 --- a/lib/libc_r/uthread/uthread_sendmsg.c +++ b/lib/libc_r/uthread/uthread_sendmsg.c @@ -38,7 +38,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_sendmsg, sendmsg); +__weak_reference(__sendmsg, sendmsg); ssize_t _sendmsg(int fd, const struct msghdr *msg, int flags) @@ -72,3 +72,15 @@ _sendmsg(int fd, const struct msghdr *msg, int flags) } return (ret); } + +ssize_t +__sendmsg(int fd, const struct msghdr *msg, int flags) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _sendmsg(fd, msg, flags); + _thread_leave_cancellation_point(); + + return (ret); +} diff --git a/lib/libc_r/uthread/uthread_sendto.c b/lib/libc_r/uthread/uthread_sendto.c index 7560ed0..17c2907 100644 --- a/lib/libc_r/uthread/uthread_sendto.c +++ b/lib/libc_r/uthread/uthread_sendto.c @@ -38,7 +38,7 @@ #include <pthread.h> #include "pthread_private.h" -__weak_reference(_sendto, sendto); +__weak_reference(__sendto, sendto); ssize_t _sendto(int fd, const void *msg, size_t len, int flags, const struct @@ -73,3 +73,16 @@ _sendto(int fd, const void *msg, size_t len, int flags, const struct } return (ret); } + +ssize_t +__sendto(int fd, const void *msg, size_t len, int flags, const struct + sockaddr * to, socklen_t to_len) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _sendto(fd, msg, len, flags, to, to_len); + _thread_leave_cancellation_point(); + + return (ret); +} |