From c489fb031802a62fb7e2e9701098814e606ab1df Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Thu, 20 Jun 2002 07:58:33 +0000 Subject: [PATCH] Make recv block only the calling thread, not the entire process. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@451 --- coregrind/arch/x86-linux/vg_libpthread.c | 2 ++ coregrind/vg_libpthread.c | 2 ++ vg_libpthread.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index b373e10ee2..3220cca1a7 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -1689,6 +1689,8 @@ int __libc_recv(int s, void *buf, size_t len, int flags); __attribute__((weak)) int recv(int s, void *buf, size_t len, int flags) { + __my_pthread_testcancel(); + wait_for_fd_to_be_readable_or_erring(s); __my_pthread_testcancel(); return __libc_recv(s, buf, len, flags); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index b373e10ee2..3220cca1a7 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1689,6 +1689,8 @@ int __libc_recv(int s, void *buf, size_t len, int flags); __attribute__((weak)) int recv(int s, void *buf, size_t len, int flags) { + __my_pthread_testcancel(); + wait_for_fd_to_be_readable_or_erring(s); __my_pthread_testcancel(); return __libc_recv(s, buf, len, flags); } diff --git a/vg_libpthread.c b/vg_libpthread.c index b373e10ee2..3220cca1a7 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1689,6 +1689,8 @@ int __libc_recv(int s, void *buf, size_t len, int flags); __attribute__((weak)) int recv(int s, void *buf, size_t len, int flags) { + __my_pthread_testcancel(); + wait_for_fd_to_be_readable_or_erring(s); __my_pthread_testcancel(); return __libc_recv(s, buf, len, flags); } -- 2.47.3