diff options
author | jilles <jilles@FreeBSD.org> | 2013-06-09 14:31:59 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-06-09 14:31:59 +0000 |
commit | 6d7e4bda619a0f4b6830347b67add508914609de (patch) | |
tree | 6e9aed9f399954d99af0c7497242890774c90a86 /lib/libc/net | |
parent | 682cdf97fe47e0e807e5da7e6a8372bffbf523f6 (diff) | |
download | FreeBSD-src-6d7e4bda619a0f4b6830347b67add508914609de.zip FreeBSD-src-6d7e4bda619a0f4b6830347b67add508914609de.tar.gz |
Make recv() and send() cancellation points, as required by POSIX.
Call the recvfrom() and sendto() functions overridden by libthr instead of
the _recvfrom() and _sendto() versions that are not cancellation points.
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/recv.c | 8 | ||||
-rw-r--r-- | lib/libc/net/send.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c index c8230d6..f71d478 100644 --- a/lib/libc/net/recv.c +++ b/lib/libc/net/recv.c @@ -33,12 +33,10 @@ static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "namespace.h" #include <sys/types.h> #include <sys/socket.h> #include <stddef.h> -#include "un-namespace.h" ssize_t recv(s, buf, len, flags) @@ -46,5 +44,9 @@ recv(s, buf, len, flags) size_t len; void *buf; { - return (_recvfrom(s, buf, len, flags, NULL, 0)); + /* + * POSIX says recv() shall be a cancellation point, so call the + * cancellation-enabled recvfrom() and not _recvfrom(). + */ + return (recvfrom(s, buf, len, flags, NULL, 0)); } diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c index 101b0ce..93cdfda 100644 --- a/lib/libc/net/send.c +++ b/lib/libc/net/send.c @@ -33,12 +33,10 @@ static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "namespace.h" #include <sys/types.h> #include <sys/socket.h> #include <stddef.h> -#include "un-namespace.h" ssize_t send(s, msg, len, flags) @@ -46,5 +44,9 @@ send(s, msg, len, flags) size_t len; const void *msg; { - return (_sendto(s, msg, len, flags, NULL, 0)); + /* + * POSIX says send() shall be a cancellation point, so call the + * cancellation-enabled sendto() and not _sendto(). + */ + return (sendto(s, msg, len, flags, NULL, 0)); } |