]> code.ossystems Code Review - openembedded-core.git/blob
2fd80ec2b21e14e0ba52457387c718db0faee573
[openembedded-core.git] /
1 Upstream-Status: Backport
2
3 From 24ee60b836ad33bb4ac694ca99d6c94a8cc5ff92 Mon Sep 17 00:00:00 2001
4 From: Mike Frysinger <vapier@gentoo.org>
5 Date: Fri, 4 May 2012 19:37:29 -0400
6 Subject: [PATCH 03/31] util: fix building when glibc has a stub
7  process_vm_readv
8
9 If you have a newer glibc which provides process_vm_readv, but it is built
10 against older kernel headers which lack __NR_process_vm_readv, the library
11 will contain a stub implementation that just returns ENOSYS.  Autoconf
12 checks for this case explicitly and will declare it as unavailable.  So we
13 end up in a case where the headers provide the prototype, but autoconf has
14 not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:
15
16 util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
17 /usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here
18
19 So rename our local function to something unique, and add a define so the
20 callers all hit the right place.
21
22 * util.c (strace_process_vm_readv): Rename from process_vm_readv.
23 (process_vm_readv): Define to strace_process_vm_readv.
24
25 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
26 ---
27  util.c | 4 +++-
28  1 file changed, 3 insertions(+), 1 deletion(-)
29
30 diff --git a/util.c b/util.c
31 index d347bd8..f27acdf 100644
32 --- a/util.c
33 +++ b/util.c
34 @@ -735,7 +735,8 @@ static bool process_vm_readv_not_supported = 0;
35  
36  #if defined(__NR_process_vm_readv)
37  static bool process_vm_readv_not_supported = 0;
38 -static ssize_t process_vm_readv(pid_t pid,
39 +/* Have to avoid duplicating with the C library headers. */
40 +static ssize_t strace_process_vm_readv(pid_t pid,
41                  const struct iovec *lvec,
42                  unsigned long liovcnt,
43                  const struct iovec *rvec,
44 @@ -744,6 +745,7 @@ static ssize_t process_vm_readv(pid_t pid,
45  {
46         return syscall(__NR_process_vm_readv, (long)pid, lvec, liovcnt, rvec, riovcnt, flags);
47  }
48 +#define process_vm_readv strace_process_vm_readv
49  #else
50  static bool process_vm_readv_not_supported = 1;
51  # define process_vm_readv(...) (errno = ENOSYS, -1)
52 -- 
53 1.8.0
54