aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2015-05-10 14:50:50 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2015-05-10 14:50:50 +0000
commit53d1c63711343b7dec15f057d75f3cf6fbac28f2 (patch)
treed23dd39cd7c5c54bd6d8420fb92181e752c10a24 /lib
parent16bf8dd6dc7e6d186051a69e75d64ca4657e7956 (diff)
downloadsrc-53d1c63711343b7dec15f057d75f3cf6fbac28f2.tar.gz
src-53d1c63711343b7dec15f057d75f3cf6fbac28f2.zip
recv(),send(): Directly call interposing entry instead of going through PLT.
recv() and send()'s calls to recvfrom() and sendto() are much like waitpid()'s call to wait4(), and likewise need not allow PLT interposing on the called function.
Notes
Notes: svn path=/head/; revision=282729
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/recv.c6
-rw-r--r--lib/libc/net/send.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c
index f71d4780bb7c..6a584cadbff6 100644
--- a/lib/libc/net/recv.c
+++ b/lib/libc/net/recv.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
+#include "libc_private.h"
#include <stddef.h>
@@ -48,5 +49,8 @@ recv(s, buf, len, flags)
* 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));
+ return (((ssize_t (*)(int, void *, size_t, int,
+ struct sockaddr *, socklen_t *))
+ __libc_interposing[INTERPOS_recvfrom])(s, buf, len, flags,
+ NULL, NULL));
}
diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c
index 93cdfda17532..c44f4b922a81 100644
--- a/lib/libc/net/send.c
+++ b/lib/libc/net/send.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
+#include "libc_private.h"
#include <stddef.h>
@@ -48,5 +49,8 @@ send(s, msg, len, flags)
* 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));
+ return (((ssize_t (*)(int, const void *, size_t, int,
+ const struct sockaddr *, socklen_t))
+ __libc_interposing[INTERPOS_sendto])(s, msg, len, flags,
+ NULL, 0));
}