Merge patch from Jeremy Fitzhardinge:
16-function-intercept
Implement a more reliable for vg_libpthread to intercept libc
calls. Since the only reliable way of making sure that our code
defines the symbol is by making sure that valgrind.so itself does it,
this patch adds a new file, vg_intercept.so, which defines those
symbols. They are then passed off to a weak local function if
libpthread isn't present, or to the libpthread version if it is.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1265 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c
index 771ed74..ed22be6 100644
--- a/coregrind/vg_libpthread.c
+++ b/coregrind/vg_libpthread.c
@@ -1826,8 +1826,8 @@
extern
int __libc_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
-__attribute__((weak))
-int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
+
+int VGL_(accept)(int s, struct sockaddr *addr, socklen_t *addrlen)
{
__my_pthread_testcancel();
wait_for_fd_to_be_readable_or_erring(s);
@@ -3067,7 +3067,7 @@
/* Turn a blocking msgsnd() into a polling non-blocking one, so that
other threads make progress */
-int msgsnd(int msgid, const void *msgp, size_t msgsz, int msgflg)
+int VGL_(msgsnd)(int msgid, const void *msgp, size_t msgsz, int msgflg)
{
struct vki_timespec nanosleep_interval;
int err;
@@ -3102,7 +3102,7 @@
/* Turn a blocking msgrcv() into a polling non-blocking one, so that
other threads make progress */
-int msgrcv( int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg )
+int VGL_(msgrcv)( int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg )
{
struct vki_timespec nanosleep_interval;
int err;