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.
This commit is contained in:
Jilles Tjoelker 2013-06-09 14:31:59 +00:00
parent 63305ba9d5
commit 42cb36d269
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251575
2 changed files with 10 additions and 6 deletions

View File

@ -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));
}

View File

@ -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));
}