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 <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2012-02-14 14:38:28 +01:00 committed by Dmitry V. Levin
parent 0ed9947c14
commit 612659e41e
2 changed files with 8 additions and 1 deletions

View File

@ -236,6 +236,7 @@ AC_CHECK_FUNCS([ \
sys_siglist \
_sys_siglist \
stpcpy \
process_vm_readv \
])
AC_CHECK_HEADERS([ \
inttypes.h \

8
util.c
View File

@ -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))