diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-02-22 21:29:49 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-02-24 23:11:37 -0500 |
commit | 63e816ad7731e40e34a7c766d895a6c6c9e8138f (patch) | |
tree | cc790cdefccdbda4ac9738a118e318c16d3da6e3 | |
parent | delete unused sandbox env vars (diff) | |
download | sandbox-63e816ad7731e40e34a7c766d895a6c6c9e8138f.tar.gz sandbox-63e816ad7731e40e34a7c766d895a6c6c9e8138f.tar.bz2 sandbox-63e816ad7731e40e34a7c766d895a6c6c9e8138f.zip |
libsandbox: handle ENOSYS w/process_vm_readv
If we have a newer glibc built against/running on an older kernel, the
func return ENOSYS at runtime. Handle that.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/trace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libsandbox/trace.c b/libsandbox/trace.c index c38ea12..32ad2d6 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -103,7 +103,12 @@ static char *do_peekstr(unsigned long lptr) riov.iov_len = liov.iov_len = len; while (1) { - process_vm_readv(trace_pid, &liov, 1, &riov, 1, 0); + if (process_vm_readv(trace_pid, &liov, 1, &riov, 1, 0) == -1) { + if (errno == ENOSYS) + break; + sb_ebort("ISE:do_peekstr: process_vm_readv() hates us: %s\n", + strerror(errno)); + } for (i = 0; i < liov.iov_len; ++i) if (!((char *)liov.iov_base)[i]) |