summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/exmap/files/exmap-0.10-kernel.patch')
-rw-r--r--dev-util/exmap/files/exmap-0.10-kernel.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/dev-util/exmap/files/exmap-0.10-kernel.patch b/dev-util/exmap/files/exmap-0.10-kernel.patch
new file mode 100644
index 000000000000..8bc58737b6d5
--- /dev/null
+++ b/dev-util/exmap/files/exmap-0.10-kernel.patch
@@ -0,0 +1,50 @@
+Tested with linux-2.6.16-gentoo-r13, linux-2.6.25-gentoo-r9, linux-2.6.26-gentoo-r4, linux-2.6.27-gentoo-r10,
+linux-2.6.28-gentoo-r6, linux-2.6.29-gentoo-r6, linux-2.6.30-gentoo-r9, linux-2.6.32-gentoo-r4, linux-2.6.32-gentoo-r5
+
+diff -ru exmap-0.10.orig/work/exmap-0.10/kernel/exmap.c exmap-0.10/work/exmap-0.10/kernel/exmap.c
+--- kernel/exmap.c 2006-09-28 18:52:25.000000000 +0200
++++ kernel/exmap.c 2010-02-17 16:15:04.000000000 +0100
+@@ -392,7 +392,11 @@
+ struct task_struct *tsk;
+ int errcode = -EINVAL;
+
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ tsk = pid_task(find_pid_ns(pid, &init_pid_ns), PIDTYPE_PID);
++ #else
+ tsk = find_task_by_pid(pid);
++ #endif
+ if (tsk == NULL) {
+ printk (KERN_ALERT
+ "/proc/%s: can't find task for pid %d\n",
+@@ -507,7 +511,11 @@
+ NULL);
+
+ if (exmap_proc_file == NULL) {
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++ remove_proc_entry (PROCFS_NAME, NULL);
++ #else
+ remove_proc_entry (PROCFS_NAME, &proc_root);
++ #endif
+ printk (KERN_ALERT "/proc/%s: could not initialize\n",
+ PROCFS_NAME);
+ return -ENOMEM;
+@@ -523,7 +523,9 @@
+
+ exmap_proc_file->read_proc = procfile_read;
+ exmap_proc_file->write_proc = procfile_write;
++ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29)
+ exmap_proc_file->owner = THIS_MODULE;
++ #endif
+
+ /* exmap_proc_file->mode = S_IFREG | S_IRUGO; */
+ /* TODO - this is quite probably a security problem */
+@@ -532,5 +540,9 @@
+ void cleanup_module ()
+ {
+ printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME);
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++ remove_proc_entry (PROCFS_NAME, NULL);
++ #else
+ remove_proc_entry (PROCFS_NAME, &proc_root);
++ #endif
+ }