1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
diff -ur strace-4.5.1/mem.c strace-4.5.1-plasmaroo/mem.c
--- strace-4.5.1/mem.c 2003-09-26 00:06:04.000000000 +0100
+++ strace-4.5.1-plasmaroo/mem.c 2003-12-25 00:32:03.000000000 +0000
@@ -32,15 +32,16 @@
* $Id: strace-4.5.1-2.6.patch,v 1.1 2003/12/25 00:42:49 plasmaroo Exp $
*/
-#include "defs.h"
-
#ifdef LINUX
#include <linux/mman.h>
#endif
#include <sys/mman.h>
+#include "defs.h"
+
#if defined(LINUX) && defined(I386)
-#include <asm/ldt.h>
+ #include <asm/ldt.h>
+ #include <linux/version.h>
#endif
#if defined(LINUX) && defined(SH64)
#include <asm/page.h> /* for PAGE_SHIFT */
@@ -539,9 +540,11 @@
}
#if defined(LINUX) && defined(__i386__)
-void
-print_ldt_entry (ldt_entry)
-struct modify_ldt_ldt_s *ldt_entry;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ void print_ldt_entry (ldt_entry) struct user_desc *ldt_entry;
+#else
+ void print_ldt_entry (ldt_entry) struct modify_ldt_ldt_s *ldt_entry;
+#endif
{
tprintf("base_addr:%#08lx, "
"limit:%d, "
@@ -566,10 +569,19 @@
struct tcb *tcp;
{
if (entering(tcp)) {
- struct modify_ldt_ldt_s copy;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct user_desc copy;
+ #else
+ struct modify_ldt_ldt_s copy;
+ #endif
tprintf("%ld", tcp->u_arg[0]);
if (tcp->u_arg[1] == 0
- || tcp->u_arg[2] != sizeof (struct modify_ldt_ldt_s)
+ || tcp->u_arg[2] != sizeof
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ (struct user_desc)
+ #else
+ (struct modify_ldt_ldt_s)
+ #endif
|| umove(tcp, tcp->u_arg[1], ©) == -1)
tprintf(", %lx", tcp->u_arg[1]);
else {
@@ -589,7 +601,11 @@
sys_set_thread_area(tcp)
struct tcb *tcp;
{
- struct modify_ldt_ldt_s copy;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct user_desc copy;
+ #else
+ struct modify_ldt_ldt_s copy;
+ #endif
if (entering(tcp)) {
if (umove(tcp, tcp->u_arg[0], ©) != -1) {
if (copy.entry_number == -1)
@@ -618,7 +634,11 @@
sys_get_thread_area(tcp)
struct tcb *tcp;
{
- struct modify_ldt_ldt_s copy;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct user_desc copy;
+ #else
+ struct modify_ldt_ldt_s copy;
+ #endif
if (exiting(tcp)) {
if (umove(tcp, tcp->u_arg[0], ©) != -1) {
tprintf("{entry_number:%d, ", copy.entry_number);
diff -ur strace-4.5.1/process.c strace-4.5.1-plasmaroo/process.c
--- strace-4.5.1/process.c 2003-11-13 22:32:26.000000000 +0000
+++ strace-4.5.1-plasmaroo/process.c 2003-12-25 00:32:02.000000000 +0000
@@ -89,6 +89,7 @@
#include <linux/futex.h>
#endif
#if defined LINUX
+#include <linux/version.h>
# ifndef FUTEX_WAIT
# define FUTEX_WAIT 0
# endif
@@ -581,7 +582,11 @@
tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]);
if (flags & CLONE_SETTLS) {
# ifdef I386
- struct modify_ldt_ldt_s copy;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct user_desc copy;
+ #else
+ struct modify_ldt_ldt_s copy;
+ #endif
if (umove(tcp, tcp->u_arg[ARG_TLS], ©) != -1) {
tprintf(", {entry_number:%d, ",
copy.entry_number);
Only in strace-4.5.1-plasmaroo/: stamp-h1
diff -ur strace-4.5.1/system.c strace-4.5.1-plasmaroo/system.c
--- strace-4.5.1/system.c 2002-11-06 14:00:13.000000000 +0000
+++ strace-4.5.1-plasmaroo/system.c 2003-12-25 00:32:03.000000000 +0000
@@ -77,6 +77,7 @@
#endif
#include <linux/sysctl.h>
+#include <linux/version.h>
static struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
@@ -1625,19 +1626,35 @@
{ 0, NULL }
};
-static struct xlat sysctl_vm[] = {
- { VM_SWAPCTL, "VM_SWAPCTL" },
- { VM_SWAPOUT, "VM_SWAPOUT" },
- { VM_FREEPG, "VM_FREEPG" },
- { VM_BDFLUSH, "VM_BDFLUSH" },
- { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
- { VM_BUFFERMEM, "VM_BUFFERMEM" },
- { VM_PAGECACHE, "VM_PAGECACHE" },
- { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
- { VM_PGT_CACHE, "VM_PGT_CACHE" },
- { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
- { 0, NULL },
-};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ static struct xlat sysctl_vm[] = {
+ { VM_UNUSED1, "VM_UNUSED1" },
+ { VM_UNUSED2, "VM_UNUSED2" },
+ { VM_UNUSED3, "VM_UNUSED3" },
+ { VM_UNUSED4, "VM_UNUSED4" },
+ { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
+ { VM_UNUSED5, "VM_UNUSED5" },
+ { VM_UNUSED7, "VM_UNUSED7" },
+ { VM_UNUSED8, "VM_UNUSED8" },
+ { VM_UNUSED9, "VM_UNUSED9" },
+ { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
+ { 0, NULL },
+ };
+#else
+ static struct xlat sysctl_vm[] = {
+ { VM_SWAPCTL, "VM_SWAPCTL" },
+ { VM_SWAPOUT, "VM_SWAPOUT" },
+ { VM_FREEPG, "VM_FREEPG" },
+ { VM_BDFLUSH, "VM_BDFLUSH" },
+ { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
+ { VM_BUFFERMEM, "VM_BUFFERMEM" },
+ { VM_PAGECACHE, "VM_PAGECACHE" },
+ { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
+ { VM_PGT_CACHE, "VM_PGT_CACHE" },
+ { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
+ { 0, NULL },
+ };
+#endif
static struct xlat sysctl_net[] = {
{ NET_CORE, "NET_CORE" },
|