• R/O
  • SSH
  • HTTPS

akari: Commit


Commit MetaInfo

Revision606 (tree)
Time2019-06-30 15:33:40
Authorkumaneko

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/akari/probe.c (revision 605)
+++ trunk/akari/probe.c (revision 606)
@@ -53,8 +53,8 @@
5353 *
5454 * Returns return value from kernel_read().
5555 */
56-static int __init my_kernel_read(struct file *file, unsigned long offset,
57- char *addr, unsigned long count)
56+static inline int my_kernel_read(struct file *file, unsigned long offset,
57+ char *addr, unsigned long count)
5858 {
5959 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
6060 /*
@@ -90,6 +90,16 @@
9090 */
9191 static void *__init probe_find_symbol(const char *keyline)
9292 {
93+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
94+ char buf[128] = { };
95+ char *cp;
96+
97+ strncpy(buf, keyline + 1, sizeof(buf) - 1);
98+ cp = strchr(buf, '\n');
99+ if (cp)
100+ *cp = '\0';
101+ return (void *) kallsyms_lookup_name(buf);
102+#else
93103 struct file *file = NULL;
94104 char *buf;
95105 unsigned long entry = 0;
@@ -177,6 +187,7 @@
177187 filp_close(file, NULL);
178188 out:
179189 return (void *) entry;
190+#endif
180191 }
181192
182193 #endif
Show on old repository browser