From: Julian Seward Date: Thu, 6 Jun 2002 08:33:54 +0000 (+0000) Subject: Cancellation wrapper for recvmsg. X-Git-Tag: svn/VALGRIND_1_0_3~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6f8b8949adc31a9823077d5b50b24b3bc1d8c6b;p=thirdparty%2Fvalgrind.git Cancellation wrapper for recvmsg. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@392 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index e575e0a8b3..5a76219fec 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -1642,6 +1642,16 @@ int sendmsg(int s, const struct msghdr *msg, int flags) } +extern +int __libc_recvmsg(int s, struct msghdr *msg, int flags); +__attribute__((weak)) +int recvmsg(int s, struct msghdr *msg, int flags) +{ + __my_pthread_testcancel(); + return __libc_recvmsg(s, msg, flags); +} + + extern int __libc_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); diff --git a/coregrind/arch/x86-linux/vg_libpthread_unimp.c b/coregrind/arch/x86-linux/vg_libpthread_unimp.c index d36aafdf27..dec5761dda 100644 --- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c +++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c @@ -207,8 +207,8 @@ weak_alias(_IO_ftrylockfile, ftrylockfile) //__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } //__attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } -__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } -__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } +//__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } +//__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } //__attribute__((weak)) void sendmsg ( void ) { vgPlain_unimp("sendmsg"); } __attribute__((weak)) void tcdrain ( void ) { vgPlain_unimp("tcdrain"); } //--//__attribute__((weak)) void vfork ( void ) { vgPlain_unimp("vfork"); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index e575e0a8b3..5a76219fec 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1642,6 +1642,16 @@ int sendmsg(int s, const struct msghdr *msg, int flags) } +extern +int __libc_recvmsg(int s, struct msghdr *msg, int flags); +__attribute__((weak)) +int recvmsg(int s, struct msghdr *msg, int flags) +{ + __my_pthread_testcancel(); + return __libc_recvmsg(s, msg, flags); +} + + extern int __libc_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index d36aafdf27..dec5761dda 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -207,8 +207,8 @@ weak_alias(_IO_ftrylockfile, ftrylockfile) //__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } //__attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } -__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } -__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } +//__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } +//__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } //__attribute__((weak)) void sendmsg ( void ) { vgPlain_unimp("sendmsg"); } __attribute__((weak)) void tcdrain ( void ) { vgPlain_unimp("tcdrain"); } //--//__attribute__((weak)) void vfork ( void ) { vgPlain_unimp("vfork"); } diff --git a/vg_libpthread.c b/vg_libpthread.c index e575e0a8b3..5a76219fec 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1642,6 +1642,16 @@ int sendmsg(int s, const struct msghdr *msg, int flags) } +extern +int __libc_recvmsg(int s, struct msghdr *msg, int flags); +__attribute__((weak)) +int recvmsg(int s, struct msghdr *msg, int flags) +{ + __my_pthread_testcancel(); + return __libc_recvmsg(s, msg, flags); +} + + extern int __libc_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); diff --git a/vg_libpthread_unimp.c b/vg_libpthread_unimp.c index d36aafdf27..dec5761dda 100644 --- a/vg_libpthread_unimp.c +++ b/vg_libpthread_unimp.c @@ -207,8 +207,8 @@ weak_alias(_IO_ftrylockfile, ftrylockfile) //__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); } //__attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); } __attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); } -__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } -__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } +//__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); } +//__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); } //__attribute__((weak)) void sendmsg ( void ) { vgPlain_unimp("sendmsg"); } __attribute__((weak)) void tcdrain ( void ) { vgPlain_unimp("tcdrain"); } //--//__attribute__((weak)) void vfork ( void ) { vgPlain_unimp("vfork"); }