1 Upstream-Status: Backport
3 From 0b4060f61f1bb101b5d8d084714b7d2feacdb199 Mon Sep 17 00:00:00 2001
4 From: Ali Polatel <alip@exherbo.org>
5 Date: Tue, 24 Sep 2013 20:04:32 +0300
6 Subject: [PATCH] Work around conflict between <sys/ptrace.h> and
9 Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args
10 which collides with <linux/ptrace.h>.
12 * configure.ac: Check for `struct ptrace_peeksiginfo_args' in
14 * process.c: Work around potential conflict between <sys/ptrace.h>
15 and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args.
17 * syscall.c: Likewise.
20 Signed-off-by: Ali Polatel <alip@exherbo.org>
27 5 files changed, 17 insertions(+), 1 deletion(-)
29 diff --git a/configure.ac b/configure.ac
30 index f19e4f2..aa4923a 100644
33 @@ -257,7 +257,7 @@ AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
35 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
37 -AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
38 +AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
39 [#include <sys/ptrace.h>])
41 AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
42 diff --git a/process.c b/process.c
43 index 1a2181b..59428a4 100644
47 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
48 # define pt_all_user_regs XXX_pt_all_user_regs
50 +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
51 +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
53 # include <linux/ptrace.h>
54 +# undef ptrace_peeksiginfo_args
56 # undef pt_all_user_regs
58 diff --git a/signal.c b/signal.c
59 index 7fb9abf..3411ddd 100644
63 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
64 # define pt_all_user_regs XXX_pt_all_user_regs
66 +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
67 +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
69 # include <linux/ptrace.h>
70 +# undef ptrace_peeksiginfo_args
72 # undef pt_all_user_regs
74 diff --git a/syscall.c b/syscall.c
75 index 83a95bd..3477dcd 100644
79 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
80 # define pt_all_user_regs XXX_pt_all_user_regs
82 +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
83 +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
85 # include <linux/ptrace.h>
86 +# undef ptrace_peeksiginfo_args
88 # undef pt_all_user_regs
90 diff --git a/util.c b/util.c
91 index 0dab902..30a7f19 100644
95 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
96 # define pt_all_user_regs XXX_pt_all_user_regs
98 +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
99 +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
101 # include <linux/ptrace.h>
102 +# undef ptrace_peeksiginfo_args
104 # undef pt_all_user_regs