From: Julian Seward Date: Thu, 20 Jun 2002 07:58:33 +0000 (+0000) Subject: Make recv block only the calling thread, not the entire process. X-Git-Tag: svn/VALGRIND_1_0_3~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c489fb031802a62fb7e2e9701098814e606ab1df;p=thirdparty%2Fvalgrind.git Make recv block only the calling thread, not the entire process. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@451 --- 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); }