Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/
Date: Mon, 25 Feb 2013 04:12:10
Message-Id: 1361765497.63e816ad7731e40e34a7c766d895a6c6c9e8138f.vapier@gentoo
1 commit: 63e816ad7731e40e34a7c766d895a6c6c9e8138f
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 23 02:29:49 2013 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 25 04:11:37 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=63e816ad
7
8 libsandbox: handle ENOSYS w/process_vm_readv
9
10 If we have a newer glibc built against/running on an older kernel, the
11 func return ENOSYS at runtime. Handle that.
12
13 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
14
15 ---
16 libsandbox/trace.c | 7 ++++++-
17 1 files changed, 6 insertions(+), 1 deletions(-)
18
19 diff --git a/libsandbox/trace.c b/libsandbox/trace.c
20 index c38ea12..32ad2d6 100644
21 --- a/libsandbox/trace.c
22 +++ b/libsandbox/trace.c
23 @@ -103,7 +103,12 @@ static char *do_peekstr(unsigned long lptr)
24 riov.iov_len = liov.iov_len = len;
25
26 while (1) {
27 - process_vm_readv(trace_pid, &liov, 1, &riov, 1, 0);
28 + if (process_vm_readv(trace_pid, &liov, 1, &riov, 1, 0) == -1) {
29 + if (errno == ENOSYS)
30 + break;
31 + sb_ebort("ISE:do_peekstr: process_vm_readv() hates us: %s\n",
32 + strerror(errno));
33 + }
34
35 for (i = 0; i < liov.iov_len; ++i)
36 if (!((char *)liov.iov_base)[i])