a46af7e5f7629cf18feeb6b82b6d688db85ab24a
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0020-update-ptrace.h-to-latest-from-glibc.patch
1 From 2d0c3a704afe6bdc7be129e9f9217ec1369c1bc8 Mon Sep 17 00:00:00 2001
2 From: James Hogan <james.hogan@imgtec.com>
3 Date: Fri, 30 Nov 2012 10:08:13 +0000
4 Subject: [PATCH] update ptrace.h to latest from glibc
5
6 Update libc/sysdeps/linux/common/sys/ptrace.h to latest from glibc's
7 sysdeps/unix/sysv/linux/sys/ptrace.h.
8
9 This adds definitions for operations:
10  - PTRACE_GETREGSET
11  - PTRACE_SETREGSET
12  - PTRACE_SEIZE
13  - PTRACE_INTERRUPT
14  - PTRACE_LISTEN
15
16 And adds flags:
17  - PTRACE_SEIZE_DEVEL
18
19 And adds event codes:
20  - PTRACE_EVENT_SECCOMP
21
22 This is to allow access to the generic interface for accessing
23 architecture specific regsets using the corresponding NT_* types,
24 required for new Linux kernel architecture ports.
25
26 Signed-off-by: James Hogan <james.hogan@imgtec.com>
27 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
28 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
29 ---
30  libc/sysdeps/linux/common/sys/ptrace.h |   42 +++++++++++++++++++++++++++-----
31  1 file changed, 36 insertions(+), 6 deletions(-)
32
33 diff --git a/libc/sysdeps/linux/common/sys/ptrace.h b/libc/sysdeps/linux/common/sys/ptrace.h
34 index 08658f9..95b3fdf 100644
35 --- a/libc/sysdeps/linux/common/sys/ptrace.h
36 +++ b/libc/sysdeps/linux/common/sys/ptrace.h
37 @@ -1,5 +1,5 @@
38  /* `ptrace' debugger support interface.  Linux version.
39 -   Copyright (C) 1996-1999,2000,2006,2007 Free Software Foundation, Inc.
40 +   Copyright (C) 1996-2012 Free Software Foundation, Inc.
41     This file is part of the GNU C Library.
42  
43     The GNU C Library is free software; you can redistribute it and/or
44 @@ -125,13 +125,40 @@ enum __ptrace_request
45  #define PT_GETSIGINFO PTRACE_GETSIGINFO
46  
47    /* Set new siginfo for process.  */
48 -  PTRACE_SETSIGINFO = 0x4203
49 +  PTRACE_SETSIGINFO = 0x4203,
50  #define PT_SETSIGINFO PTRACE_SETSIGINFO
51 +
52 +  /* Get register content.  */
53 +  PTRACE_GETREGSET = 0x4204,
54 +#define PTRACE_GETREGSET PTRACE_GETREGSET
55 +
56 +  /* Set register content.  */
57 +  PTRACE_SETREGSET = 0x4205,
58 +#define PTRACE_SETREGSET PTRACE_SETREGSET
59 +
60 +  /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
61 +     signal or group stop state.  */
62 +  PTRACE_SEIZE = 0x4206,
63 +#define PTRACE_SEIZE PTRACE_SEIZE
64 +
65 +  /* Trap seized tracee.  */
66 +  PTRACE_INTERRUPT = 0x4207,
67 +#define PTRACE_INTERRUPT PTRACE_INTERRUPT
68 +
69 +  /* Wait for next group event.  */
70 +  PTRACE_LISTEN = 0x4208
71  };
72  
73  
74 +/* Flag for PTRACE_LISTEN.  */
75 +enum __ptrace_flags
76 +{
77 +  PTRACE_SEIZE_DEVEL = 0x80000000
78 +};
79 +
80  /* Options set using PTRACE_SETOPTIONS.  */
81 -enum __ptrace_setoptions {
82 +enum __ptrace_setoptions
83 +{
84    PTRACE_O_TRACESYSGOOD        = 0x00000001,
85    PTRACE_O_TRACEFORK   = 0x00000002,
86    PTRACE_O_TRACEVFORK   = 0x00000004,
87 @@ -139,17 +166,20 @@ enum __ptrace_setoptions {
88    PTRACE_O_TRACEEXEC   = 0x00000010,
89    PTRACE_O_TRACEVFORKDONE = 0x00000020,
90    PTRACE_O_TRACEEXIT   = 0x00000040,
91 -  PTRACE_O_MASK                = 0x0000007f
92 +  PTRACE_O_TRACESECCOMP = 0x00000080,
93 +  PTRACE_O_MASK                = 0x000000ff
94  };
95  
96  /* Wait extended result codes for the above trace options.  */
97 -enum __ptrace_eventcodes {
98 +enum __ptrace_eventcodes
99 +{
100    PTRACE_EVENT_FORK    = 1,
101    PTRACE_EVENT_VFORK   = 2,
102    PTRACE_EVENT_CLONE   = 3,
103    PTRACE_EVENT_EXEC    = 4,
104    PTRACE_EVENT_VFORK_DONE = 5,
105 -  PTRACE_EVENT_EXIT    = 6
106 +  PTRACE_EVENT_EXIT    = 6,
107 +  PTRAVE_EVENT_SECCOMP  = 7
108  };
109  
110  /* Perform process tracing functions.  REQUEST is one of the values
111 -- 
112 1.7.10.4
113