[CRIU] [PATCH] ptrace.h: move PTRACE_{GET, SET}SIGMASK under ifdef

Dmitry Safonov dsafonov at virtuozzo.com
Wed Feb 24 03:13:10 PST 2016


On 02/24/2016 02:04 PM, Dmitry Safonov wrote:
> In glibc 2.23 PTRACE_{GET,SET}SIGMASK are defined at <ptrace.h>:
> http://fossies.org/diffs/glibc/2.22_vs_2.23/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h-diff.html
Suddenly, the URL is for powerpc, but I have the same
on my x86_64 after the last glibc (2.23) update:
[~]$ grep 'PTRACE_[G,S]ETSIGMASK' /usr/include/sys/ptrace.h
   PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
   PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
>
> Move them under ifdef to fix the following errors:
> In file included from arch/x86/crtools.c:14:0:
> ~/tools/criu/criu/include/ptrace.h:47:0: error: "PTRACE_GETSIGMASK" redefined [-Werror]
>   #define PTRACE_GETSIGMASK 0x420a
>   ^
> In file included from include/ptrace.h:5:0,
>                   from arch/x86/crtools.c:14:
> /usr/include/sys/ptrace.h:156:0: note: this is the location of the previous definition
>   #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
>   ^
> In file included from arch/x86/crtools.c:14:0:
> ~/tools/criu/criu/include/ptrace.h:48:0: error: "PTRACE_SETSIGMASK" redefined [-Werror]
>   #define PTRACE_SETSIGMASK 0x420b
>   ^
> In file included from include/ptrace.h:5:0,
>                   from arch/x86/crtools.c:14:
> /usr/include/sys/ptrace.h:159:0: note: this is the location of the previous definition
>   #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
>   ^
> cc1: all warnings being treated as errors
>
> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> ---
>   criu/include/ptrace.h | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/criu/include/ptrace.h b/criu/include/ptrace.h
> index 047b1e2..b32ae81 100644
> --- a/criu/include/ptrace.h
> +++ b/criu/include/ptrace.h
> @@ -44,8 +44,10 @@ struct ptrace_peeksiginfo_args {
>   # define PTRACE_SETREGSET	0x4205
>   #endif
>   
> -#define PTRACE_GETSIGMASK	0x420a
> -#define PTRACE_SETSIGMASK	0x420b
> +#ifndef PTRACE_GETSIGMASK
> +# define PTRACE_GETSIGMASK	0x420a
> +# define PTRACE_SETSIGMASK	0x420b
> +#endif
>   
>   #ifndef PTRACE_SECCOMP_GET_FILTER
>   #define PTRACE_SECCOMP_GET_FILTER	0x420c


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list