From: Mike Frysinger Date: Tue, 14 Feb 2012 13:38:28 +0000 (+0100) Subject: util: check for process_vm_readv in C library X-Git-Tag: v4.7~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=612659e41e2f41490ea5ae2926f5e002bb398334;p=strace util: check for process_vm_readv in C library glibc-2.15 provides process_vm_readv, so trying to provide it ourselves with that version fails. * configure.ac (AC_CHECK_FUNCS): Add process_vm_readv. * util.c: Handle HAVE_PROCESS_VM_READV. Signed-off-by: Mike Frysinger --- diff --git a/configure.ac b/configure.ac index 789a997d..55c7682e 100644 --- a/configure.ac +++ b/configure.ac @@ -236,6 +236,7 @@ AC_CHECK_FUNCS([ \ sys_siglist \ _sys_siglist \ stpcpy \ + process_vm_readv \ ]) AC_CHECK_HEADERS([ \ inttypes.h \ diff --git a/util.c b/util.c index b6cdf9a5..bd166d2d 100644 --- a/util.c +++ b/util.c @@ -776,6 +776,11 @@ dumpstr(struct tcb *tcp, long addr, int len) } +#ifdef HAVE_PROCESS_VM_READV +/* C library supports this, but the kernel might not. */ +static bool process_vm_readv_not_supported = 0; +#else + /* Need to do this since process_vm_readv() is not yet available in libc. * When libc is be updated, only "static bool process_vm_readv_not_supported" * line should remain. @@ -805,7 +810,8 @@ static ssize_t process_vm_readv(pid_t pid, static bool process_vm_readv_not_supported = 1; # define process_vm_readv(...) (errno = ENOSYS, -1) #endif -/* end of hack */ + +#endif /* end of hack */ #define PAGMASK (~(PAGSIZ - 1))